diff options
author | Akshay <[email protected]> | 2022-02-05 05:44:48 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-02-20 05:31:53 +0000 |
commit | 44865fcb29051ac06e981689b8673513690f6f3e (patch) | |
tree | 1dd484e93c24151f1fb752b72d9866893ce30a56 /bin/src/list.rs | |
parent | c7874ec26d6499a1196ce23432beb33764490dec (diff) |
new subcommand: statix-list
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 | } | ||