File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ var CommentsByNormedExt = map[string]map[string]string{
5353 "blockStart" : `(\{-.*)` ,
5454 "blockEnd" : `(.*-\})` ,
5555 },
56+ ".nix" : {
57+ "inline" : `(#.+)` ,
58+ "blockStart" : `(/\*.*)` ,
59+ "blockEnd" : `(.*\*/)` ,
60+ },
5661}
5762
5863// FormatByExtension associates a file extension with its "normed" extension
@@ -92,6 +97,7 @@ var FormatByExtension = map[string][]string{
9297 `\.(?:yaml|yml)$` : {".yml" , "data" },
9398 `\.(?:json)$` : {".json" , "data" },
9499 `\.(?:toml)$` : {".toml" , "data" },
100+ `\.(?:nix)$` : {".nix" , "code" },
95101}
96102
97103// FormatFromExt takes a file extension and returns its [normExt, format]
Original file line number Diff line number Diff line change @@ -43,6 +43,16 @@ Feature: Lint
4343 test.proto:31:1:vale.Annotations:'NOTE' left in text
4444 """
4545
46+ Scenario : Lint a Nix file
47+ When I lint "test.nix"
48+ Then the output should contain exactly:
49+ """
50+ test.nix:3:3:vale.Annotations:'NOTE' left in text
51+ test.nix:7:5:vale.Annotations:'XXX' left in text
52+ test.nix:10:6:vale.Annotations:'NOTE' left in text
53+ test.nix:17:7:vale.Annotations:'TODO' left in text
54+ """
55+
4656 Scenario : Lint an Org file
4757 When I lint "test.org"
4858 Then the output should contain exactly:
Original file line number Diff line number Diff line change 1+ { pkgs ? import <nixpkgs> { } } :
2+
3+ # NOTE: This is a sample Nix configuration file
4+ let
5+ myVar = "hello world" ;
6+
7+ # XXX: This needs to be fixed later
8+ brokenFunction = x : y : x + y + 1 ;
9+
10+ /* NOTE: Multi-line comment
11+ that spans multiple lines
12+ */
13+ myPackage = pkgs . stdenv . mkDerivation {
14+ pname = "example" ;
15+ version = "1.0.0" ;
16+
17+ # TODO: Add proper source
18+ src = ./. ;
19+
20+ buildPhase = ''
21+ echo "Building..."
22+ '' ;
23+ } ;
24+ in
25+ {
26+ inherit myPackage ;
27+
28+ # XXX should not match in code
29+ xxx = "XXX" ;
30+ }
You can’t perform that action at this time.
0 commit comments