feat: add shellcheckrc language (#14202)

This commit is contained in:
Kristoffer Plagborg Bak Sørensen
2025-08-31 14:53:42 +02:00
committed by GitHub
parent b309d72688
commit 6b73c3c550
5 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
(comment) @comment
(string) @string
(boolean) @constant.builtin.boolean
(integer) @constant.numeric.integer
[
"disable"
"enable"
"extended-analysis"
"external-sources"
"source"
"source-path"
"shell"
] @keyword
"=" @operator
[
","
"-"
] @punctuation.delimiter
"SC" @special
(shell) @type.enum.variant
(all) @variable.builtin
(identifier) @label
(source_directive
(identifier) @string.special.path)
(source_path_directive
(identifier) @string.special.path)
(source_directive
(identifier) @variable.builtin (#eq? @variable.builtin "SCRIPTDIR"))
(source_path_directive
(identifier) @variable.builtin (#eq? @variable.builtin "SCRIPTDIR"))
(enable_directive
(identifier) @diagnostic.error
(#not-any-of? @diagnostic.error
"add-default-case"
"avoid-nullary-conditions"
"check-extra-masked-returns"
"check-set-e-suppressed"
"check-unassigned-uppercase"
"deprecate-which"
"quote-safe-variables"
"require-double-brackets"
"require-variable-braces"
))

View File

@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

View File

@@ -0,0 +1,13 @@
(comment) @comment.inside
(comment)+ @comment.around
[
(disable_directive)
(enable_directive)
(extended_analysis_directive)
(external_sources_directive)
(source_directive)
(source_path_directive)
(shell_directive)
] @entry.around