mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
SC2324: Warn when x+=1 appends.
This commit is contained in:
parent
c9e27c2470
commit
372c0b667e
4 changed files with 64 additions and 0 deletions
|
@ -886,6 +886,15 @@ isUnmodifiedParameterExpansion t =
|
|||
in getBracedReference str == str
|
||||
_ -> False
|
||||
|
||||
-- Return the referenced variable if (and only if) it's an unmodified parameter expansion.
|
||||
getUnmodifiedParameterExpansion t =
|
||||
case t of
|
||||
T_DollarBraced _ _ list -> do
|
||||
let str = concat $ oversimplify list
|
||||
guard $ getBracedReference str == str
|
||||
return str
|
||||
_ -> Nothing
|
||||
|
||||
--- A list of the element and all its parents up to the root node.
|
||||
getPath tree t = t :
|
||||
case Map.lookup (getId t) tree of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue