From 15ccd864c8869f87a564e5ab7e923dcc2bb54340 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 31 Oct 2021 21:31:04 +0530 Subject: add explainations to each lint --- lib/src/lints/legacy_let_syntax.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/src/lints/legacy_let_syntax.rs') 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::{ NodeOrToken, SyntaxElement, SyntaxKind, }; +/// ## What it does +/// Checks for legacy-let syntax that was never formalized. +/// +/// ## Why is this bad? +/// This syntax construct is undocumented, refrain from using it. +/// +/// ## Example +/// +/// Legacy let syntax makes use of an attribute set annotated with +/// `let` and expects a `body` attribute. +/// ``` +/// let { +/// body = x + y; +/// x = 2; +/// y = 3; +/// } +/// ``` +/// +/// This is trivially representible via `rec`, which is documented +/// and more widely known: +/// +/// ``` +/// rec { +/// body = x + y; +/// x = 2; +/// y = 3; +/// }.body +/// ``` #[lint( name = "legacy let syntax", note = "Using undocumented `let` syntax", -- cgit v1.2.3