aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lints/unquoted_splice.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/unquoted_splice.rs
parent4567a246a0b63418f17ead4adc81f5ebab8bdd81 (diff)
add explainations to each lint
Diffstat (limited to 'lib/src/lints/unquoted_splice.rs')
-rw-r--r--lib/src/lints/unquoted_splice.rs24
1 files changed, 24 insertions, 0 deletions
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::{
7 NodeOrToken, SyntaxElement, SyntaxKind, 7 NodeOrToken, SyntaxElement, SyntaxKind,
8}; 8};
9 9
10/// ## What it does
11/// Checks for antiquote/splice expressions that are not quoted.
12///
13/// ## Why is this bad?
14/// An *anti*quoted expression should always occur within a *quoted*
15/// expression.
16///
17/// ## Example
18///
19/// ```
20/// let
21/// pkgs = nixpkgs.legacyPackages.${system};
22/// in
23/// pkgs
24/// ```
25///
26/// Quote the splice expression:
27///
28/// ```
29/// let
30/// pkgs = nixpkgs.legacyPackages."${system}";
31/// in
32/// pkgs
33/// ```
10#[lint( 34#[lint(
11 name = "unquoted splice", 35 name = "unquoted splice",
12 note = "Found unquoted splice expression", 36 note = "Found unquoted splice expression",