Skip to content
Merged
Show file tree
Hide file tree
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: 4 additions & 0 deletions src/cfengine_cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def _format_dirname(directory: str, line_length: int, check: bool) -> int:
continue # Hidden files are ignored by default
if name.endswith(".x.cf") or name.endswith(".input.cf"):
continue # Test files skipped during directory traversal
if name.endswith(
(".input.json", ".jqinput.json", ".x.json", ".expected.json")
):
continue # Test files skipped during directory traversal
filepath = os.path.join(root, name)
if name.endswith(".json") or name.endswith(".cf"):
ret |= _format_filename(filepath, line_length, check)
Expand Down
8 changes: 8 additions & 0 deletions src/cfengine_cli/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,14 @@ def _find_filenames_in_arg_folder(arg: str) -> list[str]:
files = [f for f in files if not f[0] == "."]
# Skip .x.cf files (policy files with intentional errors):
files = [f for f in files if not f.endswith(".x.cf")]
# Skip test-related JSON files during directory traversal:
files = [
f
for f in files
if not f.endswith(
(".input.json", ".jqinput.json", ".x.json", ".expected.json")
)
]
for name in files:
if name.endswith(LINT_EXTENSIONS):
results.append(os.path.join(root, name))
Expand Down
Loading