aboutsummaryrefslogtreecommitdiff
path: root/bin/src/list.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-02-05 05:44:48 +0000
committerAkshay <[email protected]>2022-02-20 05:31:53 +0000
commit44865fcb29051ac06e981689b8673513690f6f3e (patch)
tree1dd484e93c24151f1fb752b72d9866893ce30a56 /bin/src/list.rs
parentc7874ec26d6499a1196ce23432beb33764490dec (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.rs14
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 @@
1pub 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}