mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-05 20:41:35 -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_checkUnpassedInFunctions15 = 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 =
|
||||
execWriter $ mapM_ warnForGroup referenceGroups
|
||||
where
|
||||
|
@ -2882,9 +2884,10 @@ checkUnpassedInFunctions params root =
|
|||
|
||||
isDefaultValueModifier str =
|
||||
case str of
|
||||
'-':_ -> True
|
||||
':':'-':_ -> True
|
||||
':':c:_ -> c `elem` handlesDefault
|
||||
c:_ -> c `elem` handlesDefault
|
||||
_ -> False
|
||||
where handlesDefault = "-+?"
|
||||
|
||||
isArgumentless (_, b, _) = b
|
||||
referenceGroups = Map.elems $ foldr updateWith Map.empty referenceList
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue