mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 04:51:37 -07:00
Also ignore SC2119 for :? and :+.
This commit is contained in:
parent
7fc992d0dc
commit
553a80f77a
1 changed files with 5 additions and 2 deletions
|
@ -2827,6 +2827,8 @@ prop_checkUnpassedInFunctions13 = verifyNotTree checkUnpassedInFunctions "# shel
|
||||||
prop_checkUnpassedInFunctions14 = verifyTree checkUnpassedInFunctions "foo() { echo $#; }; foo"
|
prop_checkUnpassedInFunctions14 = verifyTree checkUnpassedInFunctions "foo() { echo $#; }; foo"
|
||||||
prop_checkUnpassedInFunctions15 = verifyNotTree checkUnpassedInFunctions "foo() { echo ${1-x}; }; foo"
|
prop_checkUnpassedInFunctions15 = verifyNotTree checkUnpassedInFunctions "foo() { echo ${1-x}; }; foo"
|
||||||
prop_checkUnpassedInFunctions16 = verifyNotTree checkUnpassedInFunctions "foo() { echo ${1:-x}; }; foo"
|
prop_checkUnpassedInFunctions16 = verifyNotTree checkUnpassedInFunctions "foo() { echo ${1:-x}; }; foo"
|
||||||
|
prop_checkUnpassedInFunctions17 = verifyNotTree checkUnpassedInFunctions "foo() { mycommand ${1+--verbose}; }; foo"
|
||||||
|
prop_checkUnpassedInFunctions18 = verifyNotTree checkUnpassedInFunctions "foo() { if mycheck; then foo ${1?Missing}; fi; }; foo"
|
||||||
checkUnpassedInFunctions params root =
|
checkUnpassedInFunctions params root =
|
||||||
execWriter $ mapM_ warnForGroup referenceGroups
|
execWriter $ mapM_ warnForGroup referenceGroups
|
||||||
where
|
where
|
||||||
|
@ -2882,9 +2884,10 @@ checkUnpassedInFunctions params root =
|
||||||
|
|
||||||
isDefaultValueModifier str =
|
isDefaultValueModifier str =
|
||||||
case str of
|
case str of
|
||||||
'-':_ -> True
|
':':c:_ -> c `elem` handlesDefault
|
||||||
':':'-':_ -> True
|
c:_ -> c `elem` handlesDefault
|
||||||
_ -> False
|
_ -> False
|
||||||
|
where handlesDefault = "-+?"
|
||||||
|
|
||||||
isArgumentless (_, b, _) = b
|
isArgumentless (_, b, _) = b
|
||||||
referenceGroups = Map.elems $ foldr updateWith Map.empty referenceList
|
referenceGroups = Map.elems $ foldr updateWith Map.empty referenceList
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue