diff options
author | Akshay <[email protected]> | 2021-10-24 08:56:37 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-24 08:56:37 +0100 |
commit | b09f1f958423dee8c235f2eeb9c148b73936830f (patch) | |
tree | 0bab5509f6dfcb46af9aa686c313f556c7ae5f0b /readme.md | |
parent | 5de0ba055cef7f2dc5451b1eaf0857deb77ae009 (diff) |
rework cli, fix is now a flag, implement dry-run mode
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 49 |
1 files changed, 45 insertions, 4 deletions
@@ -1,12 +1,53 @@ | |||
1 | ## statix | 1 | # statix |
2 | 2 | ||
3 | `statix` intends to be a static analysis tool for the | 3 | > Lints and suggestions for the Nix programming language. |
4 | Nix programming language. | 4 | |
5 | `statix` highlights antipatterns in Nix code. `statix fix` | ||
6 | can fix several such occurrences. | ||
5 | 7 | ||
6 | For the time-being, `statix` works only with ASTs | 8 | For the time-being, `statix` works only with ASTs |
7 | produced by the `rnix-parser` crate and does not evaluate | 9 | produced by the `rnix-parser` crate and does not evaluate |
8 | any nix code (imports, attr sets etc.). | 10 | any nix code (imports, attr sets etc.). |
9 | 11 | ||
12 | ## Installation | ||
13 | |||
14 | `statix` is available via a nix flake: | ||
15 | |||
16 | ``` | ||
17 | nix run git+https://git.peppe.rs/languages/statix | ||
18 | |||
19 | # or | ||
20 | |||
21 | nix build git+https://git.peppe.rs/languages/statix | ||
22 | ./result/bin/statix --help | ||
23 | ``` | ||
24 | |||
25 | ## Usage | ||
26 | |||
27 | ``` | ||
28 | statix 0.1.0 | ||
29 | |||
30 | Akshay <[email protected]> | ||
31 | |||
32 | Lints and suggestions for the Nix programming language | ||
33 | |||
34 | USAGE: | ||
35 | statix [FLAGS] [OPTIONS] [--] [TARGET] | ||
36 | |||
37 | ARGS: | ||
38 | <TARGET> File or directory to run statix on [default: .] | ||
39 | |||
40 | FLAGS: | ||
41 | -d, --dry-run Do not fix files in place, display a diff instead | ||
42 | -f, --fix Find and fix issues raised by statix | ||
43 | -h, --help Print help information | ||
44 | -V, --version Print version information | ||
45 | |||
46 | OPTIONS: | ||
47 | -i, --ignore <IGNORE>... Globs of file patterns to skip | ||
48 | -o, --format <FORMAT> Output format. Supported values: errfmt, json (on feature flag only) | ||
49 | ``` | ||
50 | |||
10 | ## Architecture | 51 | ## Architecture |
11 | 52 | ||
12 | `statix` has the following components: | 53 | `statix` has the following components: |
@@ -37,5 +78,5 @@ their metadata. | |||
37 | ## TODO | 78 | ## TODO |
38 | 79 | ||
39 | - Offline documentation for each lint | 80 | - Offline documentation for each lint |
40 | - Automatically fix all lints from suggestions generated | ||
41 | - Test suite for lints and suggestions | 81 | - Test suite for lints and suggestions |
82 | - Output singleline/errfmt + vim plugin | ||