aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md20
1 files changed, 10 insertions, 10 deletions
diff --git a/readme.md b/readme.md
index 293b72e..d1eda39 100644
--- a/readme.md
+++ b/readme.md
@@ -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
6can fix several such occurrences. 6fix` can fix several such occurrences.
7 7
8For the time-being, `statix` works only with ASTs 8For the time-being, `statix` works only with ASTs
9produced by the `rnix-parser` crate and does not evaluate 9produced 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
57statix /path/to/dir 57statix check /path/to/dir
58 58
59# ignore generated files, such as Cargo.nix 59# ignore generated files, such as Cargo.nix
60statix /path/to/dir -i '*Cargo.nix' 60statix 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
66the source with: 66the source with:
67 67
68```shell 68```shell
69statix --fix /path/to/file 69statix fix /path/to/file
70 70
71# show diff, do not write to file 71# show diff, do not write to file
72statix --fix --dry-run /path/to/file 72statix 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,
76json and errfmt: 76json and errfmt:
77 77
78```shell 78```shell
79statix /path/to/dir -o json 79statix check /path/to/dir -o json # only when compiled with --all-features
80statix /path/to/dir -o errfmt # singleline, easy to integrate with vim 80statix check /path/to/dir -o errfmt # singleline, easy to integrate with vim
81``` 81```
82 82
83## Architecture 83## Architecture