mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-13 16:43:20 -07:00
Warn when $? refers to echo or condition (ref #2541)
This commit is contained in:
parent
b261ec24f9
commit
5cf6e01ce9
4 changed files with 42 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue