Skip to content

Commit

Permalink
queries/nix: add injection rule for python test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pacien committed Feb 3, 2023
1 parent 7b46a6c commit abe223c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/queries/nix/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
(#set! injection.language "bash")
(#set! injection.combined))

; Common attribute keys corresponding to Python scripts,
; such as those for NixOS VM tests in nixpkgs/nixos/tests.
((binding
attrpath: (attrpath (identifier) @_path)
expression: (indented_string_expression
(string_fragment) @injection.content))
(#match? @_path "(^|\\.)testScript$")
(#set! injection.language "python")
(#set! injection.combined))

; builtins.{match,split} regex str
; Example: nix/tests/lang/eval-okay-regex-{match,split}.nix
((apply_expression
Expand Down

0 comments on commit abe223c

Please sign in to comment.