mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-21 22:03:45 -07:00
Problem: then word in pcs scripts confuse ShellCheck
Pacemaker-related scripts often use 'then' word unquoted and it does work in bash. Example: ``` pcs constraint order VirtualIP then dummy_resource kind=Optional ``` This instruction causes SC1010 warning which seems to be a false-positive. It seems like 'then' word itself is not a keyword in bash. I guess that it is understood as a keyword only in context of `if` clause. Solution: Exclude 'then' from the list of terminal tokens in `readNormalWord` function.
This commit is contained in:
parent
163b2f12e2
commit
a07800fbc3
1 changed files with 1 additions and 1 deletions
|
@ -1068,7 +1068,7 @@ prop_readNormalWord9 = isOk readSubshell "(foo\\ ;\nbar)"
|
||||||
prop_readNormalWord10 = isWarning readNormalWord "\x201Chello\x201D"
|
prop_readNormalWord10 = isWarning readNormalWord "\x201Chello\x201D"
|
||||||
prop_readNormalWord11 = isWarning readNormalWord "\x2018hello\x2019"
|
prop_readNormalWord11 = isWarning readNormalWord "\x2018hello\x2019"
|
||||||
prop_readNormalWord12 = isWarning readNormalWord "hello\x2018"
|
prop_readNormalWord12 = isWarning readNormalWord "hello\x2018"
|
||||||
readNormalWord = readNormalishWord "" ["do", "done", "then", "fi", "esac"]
|
readNormalWord = readNormalishWord "" ["do", "done", "fi", "esac"]
|
||||||
|
|
||||||
readPatternWord = readNormalishWord "" ["esac"]
|
readPatternWord = readNormalishWord "" ["esac"]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue