mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 12:37:14 +08:00
Warn when $? refers to echo or condition (ref #2541)
This commit is contained in:
@@ -89,6 +89,8 @@ data Parameters = Parameters {
|
||||
hasPipefail :: Bool,
|
||||
-- A linear (bad) analysis of data flow
|
||||
variableFlow :: [StackData],
|
||||
-- A map from Id to Token
|
||||
idMap :: Map.Map Id Token,
|
||||
-- A map from Id to parent Token
|
||||
parentMap :: Map.Map Id Token,
|
||||
-- The shell type, such as Bash or Ksh
|
||||
@@ -218,6 +220,7 @@ makeParameters spec = params
|
||||
Sh -> True
|
||||
Ksh -> containsPipefail root,
|
||||
shellTypeSpecified = isJust (asShellType spec) || isJust (asFallbackShell spec),
|
||||
idMap = getTokenMap root,
|
||||
parentMap = getParentTree root,
|
||||
variableFlow = getVariableFlow params root,
|
||||
tokenPositions = asTokenPositions spec,
|
||||
|
Reference in New Issue
Block a user