mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-30 08:49:20 +08:00
SC2324: Warn when x+=1 appends.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user