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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ cfengine format
cfengine lint
```

You can also specify filenames or folders;

```bash
cfengine lint main.cf
```

When it finds a mistake, it points out where the problem is like this;

```
"Hello, CFEngine"
ifvarclass => "cfengine";
^--------^
Deprecation: Use 'if' instead of 'ifvarclass' at main.cf:5:7
FAIL: main.cf (1 errors)
Failure, 1 errors in total.
```

Note that since we use a different parser than `cf-agent` / `cf-promises`, they are not 100% in sync.
`cf-agent` could point out something as a syntax error, while `cfengine lint` does not and vice versa.
We aim to make the tree-sitter parser (used in this tool) more strict in general, so that when `cfengine lint` is happy with your policy, `cf-agent` will also accept it.
Expand Down
2 changes: 1 addition & 1 deletion src/cfengine_cli/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,4 @@ def lint_single_arg(arg, strict=True):
return lint_folder(arg, strict)
assert os.path.isfile(arg)

return lint_single_file(arg, strict)
return lint_single_file(arg, strict=strict)
Loading