diff options
author | Akshay <[email protected]> | 2022-02-05 05:44:48 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-02-05 05:44:48 +0000 |
commit | 99bdafa7b98e478b5375db2d606409aa29150bcd (patch) | |
tree | 1b242ef6849b0dc8e67e2f525939c04b2c86f5fd /bin/src/list.rs | |
parent | ade09b4d172ff649b716a05ce597d2da864a3623 (diff) |
new subcommand: statix-listfeat/list-lints
produces a list of lints with their error codes,
handy for statix-explain or configuring the `disabled`
array in .statix.toml
Diffstat (limited to 'bin/src/list.rs')
-rw-r--r-- | bin/src/list.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/src/list.rs b/bin/src/list.rs new file mode 100644 index 0000000..4fe3039 --- /dev/null +++ b/bin/src/list.rs | |||
@@ -0,0 +1,14 @@ | |||
1 | pub mod main { | ||
2 | use crate::err::StatixErr; | ||
3 | |||
4 | use lib::LINTS; | ||
5 | |||
6 | pub fn main() -> Result<(), StatixErr> { | ||
7 | let mut lints = (&*LINTS).clone(); | ||
8 | lints.as_mut_slice().sort_by(|a, b| a.code().cmp(&b.code())); | ||
9 | for l in lints { | ||
10 | println!("W{:02} {}", l.code(), l.name()); | ||
11 | } | ||
12 | Ok(()) | ||
13 | } | ||
14 | } | ||