Skip to content

Commit 073f447

Browse files
committed
Added example of cfengine lint output to README
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
1 parent c51d6b6 commit 073f447

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ cfengine format
4747
cfengine lint
4848
```
4949

50+
You can also specify filenames or folders;
51+
52+
```bash
53+
cfengine lint main.cf
54+
```
55+
56+
When it finds a mistake, it points out where the problem is like this;
57+
58+
```
59+
"Hello, CFEngine"
60+
ifvarclass => "cfengine";
61+
^--------^
62+
Deprecation: Use 'if' instead of 'ifvarclass' at main.cf:5:7
63+
FAIL: main.cf (1 errors)
64+
Failure, 1 errors in total.
65+
```
66+
5067
Note that since we use a different parser than `cf-agent` / `cf-promises`, they are not 100% in sync.
5168
`cf-agent` could point out something as a syntax error, while `cfengine lint` does not and vice versa.
5269
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.

0 commit comments

Comments
 (0)