diff options
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | > Lints and suggestions for the Nix programming language. | 3 | > Lints and suggestions for the Nix programming language. |
4 | 4 | ||
5 | `statix` highlights antipatterns in Nix code. `statix --fix` | 5 | `statix check` highlights antipatterns in Nix code. `statix |
6 | can fix several such occurrences. | 6 | fix` can fix several such occurrences. |
7 | 7 | ||
8 | For the time-being, `statix` works only with ASTs | 8 | For the time-being, `statix` works only with ASTs |
9 | produced by the `rnix-parser` crate and does not evaluate | 9 | produced by the `rnix-parser` crate and does not evaluate |
@@ -12,7 +12,7 @@ any nix code (imports, attr sets etc.). | |||
12 | ## Examples | 12 | ## Examples |
13 | 13 | ||
14 | ```shell | 14 | ```shell |
15 | $ statix tests/c.nix | 15 | $ statix check tests/c.nix |
16 | [W04] Warning: Assignment instead of inherit from | 16 | [W04] Warning: Assignment instead of inherit from |
17 | ╭─[tests/c.nix:2:3] | 17 | ╭─[tests/c.nix:2:3] |
18 | │ | 18 | │ |
@@ -21,7 +21,7 @@ $ statix tests/c.nix | |||
21 | · ╰───────────────── This assignment is better written with inherit | 21 | · ╰───────────────── This assignment is better written with inherit |
22 | ───╯ | 22 | ───╯ |
23 | 23 | ||
24 | $ statix --fix --dry-run tests/c.nix | 24 | $ statix fix --dry-run tests/c.nix |
25 | --- tests/c.nix | 25 | --- tests/c.nix |
26 | +++ tests/c.nix [fixed] | 26 | +++ tests/c.nix [fixed] |
27 | @@ -1,6 +1,6 @@ | 27 | @@ -1,6 +1,6 @@ |
@@ -54,10 +54,10 @@ Basic usage is as simple as: | |||
54 | 54 | ||
55 | ```shell | 55 | ```shell |
56 | # recursively finds nix files and raises lints | 56 | # recursively finds nix files and raises lints |
57 | statix /path/to/dir | 57 | statix check /path/to/dir |
58 | 58 | ||
59 | # ignore generated files, such as Cargo.nix | 59 | # ignore generated files, such as Cargo.nix |
60 | statix /path/to/dir -i '*Cargo.nix' | 60 | statix check /path/to/dir -i '*Cargo.nix' |
61 | 61 | ||
62 | # see `statix -h` for a full list of options | 62 | # see `statix -h` for a full list of options |
63 | ``` | 63 | ``` |
@@ -66,18 +66,18 @@ Certain lints have suggestions. Apply suggestions back to | |||
66 | the source with: | 66 | the source with: |
67 | 67 | ||
68 | ```shell | 68 | ```shell |
69 | statix --fix /path/to/file | 69 | statix fix /path/to/file |
70 | 70 | ||
71 | # show diff, do not write to file | 71 | # show diff, do not write to file |
72 | statix --fix --dry-run /path/to/file | 72 | statix fix --dry-run /path/to/file |
73 | ``` | 73 | ``` |
74 | 74 | ||
75 | `statix` supports a variety of output formats; standard, | 75 | `statix` supports a variety of output formats; standard, |
76 | json and errfmt: | 76 | json and errfmt: |
77 | 77 | ||
78 | ```shell | 78 | ```shell |
79 | statix /path/to/dir -o json | 79 | statix check /path/to/dir -o json # only when compiled with --all-features |
80 | statix /path/to/dir -o errfmt # singleline, easy to integrate with vim | 80 | statix check /path/to/dir -o errfmt # singleline, easy to integrate with vim |
81 | ``` | 81 | ``` |
82 | 82 | ||
83 | ## Architecture | 83 | ## Architecture |