Skip to content

Commit b4494e1

Browse files
pacienthe-mikedavis
authored andcommittedSep 16, 2023
queries/nix: add injection rule for python test scripts
1 parent 0e55648 commit b4494e1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎runtime/queries/nix/injections.scm

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
(indented_string_expression (string_fragment) @injection.content))
77
(#set! injection.combined))
88

9+
; Common attribute keys corresponding to Python scripts,
10+
; such as those for NixOS VM tests in nixpkgs/nixos/tests.
11+
((binding
12+
attrpath: (attrpath (identifier) @_path)
13+
expression: (indented_string_expression
14+
(string_fragment) @injection.content))
15+
(#match? @_path "(^|\\.)testScript$")
16+
(#set! injection.language "python")
17+
(#set! injection.combined))
18+
919
; Common attribute keys corresponding to scripts,
1020
; such as those of stdenv.mkDerivation.
1121
((binding

0 commit comments

Comments
 (0)