Commit Graph

51 Commits

Author SHA1 Message Date
Stanisław Pitucha
6463c05411 new lint: repeated_keys
Check for repeated keys in attrsets. For example:

```
foo.bar1 = 1;
foo.bar2 = 2;
foo.bar3 = 3;
```

should recommend creating a

```
foo = { ... }
```

Report only on multi-level keys

Add tests

tweak repeated-keys lint
2023-01-08 13:47:26 +05:30
Akshay
11066fbbdd raise, don't fix for empty_let_in with comments 2022-06-04 21:54:01 +05:30
Akshay
33490aa211 do not raise empty-let when comments are present 2022-06-04 16:20:19 +05:30
Akshay
c917670c91 useless_has_attr: do not parenthesize select expressions in fixes
`select` expresisons are more tightly binding than `or` expressions,
we do not have to parenthesize them when placed next to an `or`.
2022-02-20 11:29:59 +05:30
Akshay
c7874ec26d new lint: useless_has_attr 2022-02-20 11:01:36 +05:30
Akshay
e8130a90dc new lint: bool_simplification
TODO: add more patterns to this
2022-02-20 09:37:32 +05:30
Akshay
a80e252193 parallelize statix-check 2022-02-19 20:44:59 +05:30
Akshay
7457498ea6 new lint: deprecated_to_path 2022-01-30 12:30:51 +05:30
Akshay
a254edfcd2 new lint: faster_zipattrswith 2022-01-30 12:10:21 +05:30
Akshay
effe06e2f1 do not use git dependency 2022-01-29 16:58:19 +05:30
Akshay
df29effd59 bump rnix to latest master, support nix 2.5 syntax 2022-01-29 16:31:20 +05:30
Akshay
8e4eeb979e do not raise empty_pattern on nixos modules 2022-01-29 10:13:41 +05:30
Akshay
7d732a051e refactor parsing code, simplify tests 2022-01-14 18:09:42 +05:30
Akshay
d1ff222bcf allow for version based lints 2022-01-08 16:03:10 +05:30
Akshay
21775f28cd new lint: empty_inherit 2021-12-04 13:04:20 +05:30
Akshay
1079486539 remove lint: unquoted_splice 2021-11-28 19:25:36 +05:30
Akshay
2b6012a79c introduce --config flag 2021-11-28 13:25:23 +05:30
Akshay
4e063b2abc add snapshot test suite 2021-11-08 10:33:13 +05:30
Akshay
96a404acfc add missing explanation to deprecated_is_null 2021-11-04 22:00:13 +05:30
Akshay
07d39899d3 new lint: deprecated_is_null 2021-11-04 17:06:02 +05:30
Akshay
5b87c6feb3 new lint: unquoted_uri 2021-11-02 13:18:36 +05:30
figsoda
831bd7e91d apply clippy lints 2021-11-01 22:34:22 -04:00
figsoda
78dda5ec5a fix tests 2021-10-31 20:45:57 -04:00
Akshay
e8c955da4c add explain subcommand and explanations to all lints 2021-10-31 21:35:15 +05:30
Akshay
1a97cce01f report syntax errors as statix errors
- statix now reports errors also, not just warnings
- all diagnostics are available on stderr stream
- non-utf8 files are skipped, does not eject early
2021-10-29 18:44:14 +05:30
Daniel Thwaites
d510714ed5 filter out invalid eta-reductions
if the remaining expression after eta-reduction still contains the
removed function argument, eta-reduction is not possible.
2021-10-29 18:44:14 +05:30
Akshay
a627799e2a improve json output
The `at` field now includes a `from` and `to` position with line and
column information, instead of a [usize; 2].
2021-10-28 17:14:21 +05:30
Akshay
3c9a675b9d fix fp with manual_inherit and manual_inherit_from
the lint also needed to validate if the length of the path component was
exactly one, and not just check if the first component matches the
value.
2021-10-28 07:50:36 +05:30
Akshay
8eccf15964 add 3 new lints, bump to v0.2.3
- empty_pattern
- redundant_pattern_bind
- unquoted_splice
2021-10-28 00:33:48 +05:30
Akshay
f909b20c54 allow stdin input to statix-single, vim plugin 2021-10-27 17:13:23 +05:30
Akshay
ed1ee66b06 add MIT license 2021-10-27 08:02:57 +05:30
Akshay
20d195988d set internal crates to 0.0.0, bump to v0.2.0 2021-10-26 19:50:23 +05:30
Akshay
5de0ba055c add support for json out 2021-10-24 13:24:52 +05:30
Akshay
dfcdaf9167 add suggestion application logic 2021-10-23 12:41:30 +05:30
Akshay
e8f5ed3a5c fix useless_parens: lint on idents as well 2021-10-23 12:41:09 +05:30
Akshay
b26272ba3e minor refactor 2021-10-19 22:27:23 +05:30
Akshay
d666cfa6b1 rework few error messages 2021-10-19 16:00:03 +05:30
Akshay
2993b205db new lint: useless_parens 2021-10-15 13:06:59 +05:30
Akshay
45ab8abf76 allow match_kind to accept multiple kinds 2021-10-15 13:06:29 +05:30
Akshay
c6ea58410c new lint: eta_reduction 2021-10-08 21:47:07 +05:30
Akshay
df6d9dc1c3 consistent naming 2021-10-03 16:59:54 +05:30
Akshay
fc6409142e new lint: collapsible_let_in 2021-10-03 16:58:38 +05:30
Akshay
c5c4b55c2b new lint: legacy_let_syntax 2021-10-02 20:53:19 +05:30
Akshay
7a430237ee new lint: manual_inherit_from 2021-10-02 18:40:08 +05:30
Akshay
c00900120d new lint: manual_inherit 2021-10-02 13:39:39 +05:30
Akshay
a60429891f new lint: empty-let-in 2021-10-02 10:51:27 +05:30
Akshay
7953d8cc93 add error code and report codegen, document a bit 2021-09-21 20:51:20 +05:30
Akshay
40867728c0 add suggestion to bool_comparison 2021-09-21 16:41:24 +05:30
Akshay
2ee7db0b3b implement lint_map 2021-09-15 16:19:43 +05:30
Akshay
4152367f5d add demo lint: bool_comparison 2021-09-13 22:20:25 +05:30