aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lints/legacy_let_syntax.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-31 16:01:04 +0000
committerAkshay <[email protected]>2021-10-31 16:01:04 +0000
commit15ccd864c8869f87a564e5ab7e923dcc2bb54340 (patch)
tree9d47b230d5d4ad1b0f40ba88f097418b981805a4 /lib/src/lints/legacy_let_syntax.rs
parent4567a246a0b63418f17ead4adc81f5ebab8bdd81 (diff)
add explainations to each lint
Diffstat (limited to 'lib/src/lints/legacy_let_syntax.rs')
-rw-r--r--lib/src/lints/legacy_let_syntax.rs28
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",