diff options
Diffstat (limited to 'lib/src/lints/legacy_let_syntax.rs')
-rw-r--r-- | lib/src/lints/legacy_let_syntax.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/src/lints/legacy_let_syntax.rs b/lib/src/lints/legacy_let_syntax.rs index 8b37df8..139f633 100644 --- a/lib/src/lints/legacy_let_syntax.rs +++ b/lib/src/lints/legacy_let_syntax.rs | |||
@@ -7,6 +7,34 @@ use rnix::{ | |||
7 | NodeOrToken, SyntaxElement, SyntaxKind, | 7 | NodeOrToken, SyntaxElement, SyntaxKind, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | /// ## What it does | ||
11 | /// Checks for legacy-let syntax that was never formalized. | ||
12 | /// | ||
13 | /// ## Why is this bad? | ||
14 | /// This syntax construct is undocumented, refrain from using it. | ||
15 | /// | ||
16 | /// ## Example | ||
17 | /// | ||
18 | /// Legacy let syntax makes use of an attribute set annotated with | ||
19 | /// `let` and expects a `body` attribute. | ||
20 | /// ``` | ||
21 | /// let { | ||
22 | /// body = x + y; | ||
23 | /// x = 2; | ||
24 | /// y = 3; | ||
25 | /// } | ||
26 | /// ``` | ||
27 | /// | ||
28 | /// This is trivially representible via `rec`, which is documented | ||
29 | /// and more widely known: | ||
30 | /// | ||
31 | /// ``` | ||
32 | /// rec { | ||
33 | /// body = x + y; | ||
34 | /// x = 2; | ||
35 | /// y = 3; | ||
36 | /// }.body | ||
37 | /// ``` | ||
10 | #[lint( | 38 | #[lint( |
11 | name = "legacy let syntax", | 39 | name = "legacy let syntax", |
12 | note = "Using undocumented `let` syntax", | 40 | note = "Using undocumented `let` syntax", |