···11[package]
22name = "statix"
33-version = "0.1.0"
33+version = "0.2.0"
44edition = "2018"
5566# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+2-1
bin/src/config.rs
···234234 match value.to_ascii_lowercase().as_str() {
235235 #[cfg(feature = "json")]
236236 "json" => Ok(Self::Json),
237237+ #[cfg(not(feature = "json"))]
238238+ "json" => Err("statix was not compiled with the `json` feature flag"),
237239 "errfmt" => Ok(Self::Errfmt),
238240 "stderr" => Ok(Self::StdErr),
239239- "json" => Err("statix was not compiled with the `json` feature flag"),
240241 _ => Err("unknown output format, try: json, errfmt"),
241242 }
242243 }
+1-1
bin/src/err.rs
···1111 #[error("path error: {0}")]
1212 InvalidPath(#[from] io::Error),
1313 #[error("unable to parse `{0}` as line and column")]
1414- InvalidPosition(String)
1414+ InvalidPosition(String),
1515}
16161717#[derive(Error, Debug)]
···49495050 statix = with final; pkgs.stdenv.mkDerivation {
5151 pname = "statix";
5252- version = "v0.1.0";
5252+ version = "v0.2.0";
5353 src = builtins.path {
5454 path = ./.;
5555 name = "statix";
+1-1
lib/Cargo.toml
···11[package]
22name = "lib"
33-version = "0.1.0"
33+version = "0.0.0"
44edition = "2018"
5566# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
···11[package]
22name = "macros"
33-version = "0.1.0"
33+version = "0.0.0"
44edition = "2018"
5566# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+10-10
readme.md
···2233> Lints and suggestions for the Nix programming language.
4455-`statix` highlights antipatterns in Nix code. `statix --fix`
66-can fix several such occurrences.
55+`statix check` highlights antipatterns in Nix code. `statix
66+fix` can fix several such occurrences.
7788For the time-being, `statix` works only with ASTs
99produced by the `rnix-parser` crate and does not evaluate
···1212## Examples
13131414```shell
1515-$ statix tests/c.nix
1515+$ statix check tests/c.nix
1616[W04] Warning: Assignment instead of inherit from
1717 ╭─[tests/c.nix:2:3]
1818 │
···2121 · ╰───────────────── This assignment is better written with inherit
2222───╯
23232424-$ statix --fix --dry-run tests/c.nix
2424+$ statix fix --dry-run tests/c.nix
2525--- tests/c.nix
2626+++ tests/c.nix [fixed]
2727@@ -1,6 +1,6 @@
···54545555```shell
5656# recursively finds nix files and raises lints
5757-statix /path/to/dir
5757+statix check /path/to/dir
58585959# ignore generated files, such as Cargo.nix
6060-statix /path/to/dir -i '*Cargo.nix'
6060+statix check /path/to/dir -i '*Cargo.nix'
61616262# see `statix -h` for a full list of options
6363```
···6666the source with:
67676868```shell
6969-statix --fix /path/to/file
6969+statix fix /path/to/file
70707171# show diff, do not write to file
7272-statix --fix --dry-run /path/to/file
7272+statix fix --dry-run /path/to/file
7373```
74747575`statix` supports a variety of output formats; standard,
7676json and errfmt:
77777878```shell
7979-statix /path/to/dir -o json
8080-statix /path/to/dir -o errfmt # singleline, easy to integrate with vim
7979+statix check /path/to/dir -o json # only when compiled with --all-features
8080+statix check /path/to/dir -o errfmt # singleline, easy to integrate with vim
8181```
82828383## Architecture