Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pyinfra/facts/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def process(self, output):
return output


class FileContents(FactBase):
class FileContents(FactBase[list[str] | None]):
"""
Returns the contents of a file as a list of lines, or ``None`` if the file does not exist.
"""
Expand All @@ -719,7 +719,7 @@ def command(self, path):
)

@override
def process(self, output):
def process(self, output) -> list[str] | None:
# If output is the missing flag, the file doesn't exist
if output and output[0] == self.missing_flag:
return None
Expand Down
Loading