diff options
author | Akshay <[email protected]> | 2021-10-31 16:01:04 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-31 16:01:04 +0000 |
commit | 15ccd864c8869f87a564e5ab7e923dcc2bb54340 (patch) | |
tree | 9d47b230d5d4ad1b0f40ba88f097418b981805a4 /lib/src/lints/redundant_pattern_bind.rs | |
parent | 4567a246a0b63418f17ead4adc81f5ebab8bdd81 (diff) |
add explainations to each lint
Diffstat (limited to 'lib/src/lints/redundant_pattern_bind.rs')
-rw-r--r-- | lib/src/lints/redundant_pattern_bind.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/src/lints/redundant_pattern_bind.rs b/lib/src/lints/redundant_pattern_bind.rs index ad1aba8..5b0711f 100644 --- a/lib/src/lints/redundant_pattern_bind.rs +++ b/lib/src/lints/redundant_pattern_bind.rs | |||
@@ -7,10 +7,29 @@ use rnix::{ | |||
7 | NodeOrToken, SyntaxElement, SyntaxKind, | 7 | NodeOrToken, SyntaxElement, SyntaxKind, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | /// ## What it does | ||
11 | /// Checks for binds of the form `inputs @ { ... }` in function | ||
12 | /// arguments. | ||
13 | /// | ||
14 | /// ## Why is this bad? | ||
15 | /// The variadic pattern here is redundant, as it does not capture | ||
16 | /// anything. | ||
17 | /// | ||
18 | /// ## Example | ||
19 | /// | ||
20 | /// ``` | ||
21 | /// inputs @ { ... }: inputs.nixpkgs | ||
22 | /// ``` | ||
23 | /// | ||
24 | /// Remove the pattern altogether: | ||
25 | /// | ||
26 | /// ``` | ||
27 | /// inputs: inputs.nixpkgs | ||
28 | /// ``` | ||
10 | #[lint( | 29 | #[lint( |
11 | name = "redundant pattern bind", | 30 | name = "redundant pattern bind", |
12 | note = "Found redundant pattern bind in function argument", | 31 | note = "Found redundant pattern bind in function argument", |
13 | code = 10, | 32 | code = 11, |
14 | match_with = SyntaxKind::NODE_PATTERN | 33 | match_with = SyntaxKind::NODE_PATTERN |
15 | )] | 34 | )] |
16 | struct RedundantPatternBind; | 35 | struct RedundantPatternBind; |