mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-09 12:08:38 +08:00
Allow quoting values in directives (fixes #2517)
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user