Issue 824 grep fixed strings and SC2063

Issue https://github.com/koalaman/shellcheck/issues/824

Fix up to original change to include '--fixed-strings' in the grep +
regex special cases.
This commit is contained in:
Gandalf- 2019-01-19 08:49:26 -08:00
parent ec6f9e4d49
commit 661be056f1
1 changed files with 2 additions and 1 deletions

View File

@ -212,6 +212,7 @@ prop_checkGrepRe16= verifyNot checkGrepRe "grep --include 'Foo*' file"
prop_checkGrepRe17= verifyNot checkGrepRe "grep --exclude 'Foo*' file"
prop_checkGrepRe18= verifyNot checkGrepRe "grep --exclude-dir 'Foo*' file"
prop_checkGrepRe19= verify checkGrepRe "grep -- 'Foo*' file"
prop_checkGrepRe20= verifyNot checkGrepRe "grep --fixed-strings 'Foo*' file"
checkGrepRe = CommandCheck (Basename "grep") check where
check cmd = f cmd (arguments cmd)
@ -244,7 +245,7 @@ checkGrepRe = CommandCheck (Basename "grep") check where
"Note that unlike globs, " ++ [char] ++ "* here matches '" ++ [char, char, char] ++ "' but not '" ++ wordStartingWith char ++ "'."
where
flags = map snd $ getAllFlags cmd
grepGlobFlags = ["F", "include", "exclude", "exclude-dir"]
grepGlobFlags = ["fixed-strings", "F", "include", "exclude", "exclude-dir"]
wordStartingWith c =
head . filter ([c] `isPrefixOf`) $ candidates