mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 13:31:36 -07:00
Allow quoting values in directives (fixes #2517)
This commit is contained in:
parent
f440912279
commit
d0dd81e1fa
4 changed files with 33 additions and 6 deletions
|
@ -244,6 +244,9 @@ prop_canStripPrefixAndSource2 =
|
|||
prop_canSourceDynamicWhenRedirected =
|
||||
null $ checkWithIncludes [("lib", "")] "#shellcheck source=lib\n. \"$1\""
|
||||
|
||||
prop_canRedirectWithSpaces =
|
||||
null $ checkWithIncludes [("my file", "")] "#shellcheck source=\"my file\"\n. \"$1\""
|
||||
|
||||
prop_recursiveAnalysis =
|
||||
[2086] == checkRecursive [("lib", "echo $1")] "source lib"
|
||||
|
||||
|
@ -413,6 +416,15 @@ prop_sourcePathAddsAnnotation = result == [2086]
|
|||
csCheckSourced = True
|
||||
}
|
||||
|
||||
prop_sourcePathWorksWithSpaces = result == [2086]
|
||||
where
|
||||
f "dir/myscript" _ ["my path"] "lib" = return "foo/lib"
|
||||
result = checkWithIncludesAndSourcePath [("foo/lib", "echo $1")] f emptyCheckSpec {
|
||||
csScript = "#!/bin/bash\n# shellcheck source-path='my path'\nsource lib",
|
||||
csFilename = "dir/myscript",
|
||||
csCheckSourced = True
|
||||
}
|
||||
|
||||
prop_sourcePathRedirectsDirective = result == [2086]
|
||||
where
|
||||
f "dir/myscript" _ _ "lib" = return "foo/lib"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue