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/unquoted_splice.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/src/lints/unquoted_splice.rs') diff --git a/lib/src/lints/unquoted_splice.rs b/lib/src/lints/unquoted_splice.rs index 2831c1b..c2fd6e4 100644 --- a/lib/src/lints/unquoted_splice.rs +++ b/lib/src/lints/unquoted_splice.rs @@ -7,6 +7,30 @@ use rnix::{ NodeOrToken, SyntaxElement, SyntaxKind, }; +/// ## What it does +/// Checks for antiquote/splice expressions that are not quoted. +/// +/// ## Why is this bad? +/// An *anti*quoted expression should always occur within a *quoted* +/// expression. +/// +/// ## Example +/// +/// ``` +/// let +/// pkgs = nixpkgs.legacyPackages.${system}; +/// in +/// pkgs +/// ``` +/// +/// Quote the splice expression: +/// +/// ``` +/// let +/// pkgs = nixpkgs.legacyPackages."${system}"; +/// in +/// pkgs +/// ``` #[lint( name = "unquoted splice", note = "Found unquoted splice expression", -- cgit v1.2.3