mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Example plumbing for Portage variables
This commit is contained in:
parent
90d3172dfe
commit
0138a6fafc
9 changed files with 96 additions and 59 deletions
|
@ -314,7 +314,7 @@ runAndGetComments f s = do
|
|||
let pr = pScript s
|
||||
root <- prRoot pr
|
||||
let spec = defaultSpec pr
|
||||
let params = makeParameters spec
|
||||
let params = runIdentity $ makeParameters (mockedSystemInterface []) spec
|
||||
return $
|
||||
filterByAnnotation spec params $
|
||||
f params root
|
||||
|
@ -2451,7 +2451,7 @@ checkUnassignedReferences = checkUnassignedReferences' False
|
|||
checkUnassignedReferences' includeGlobals params t = warnings
|
||||
where
|
||||
(readMap, writeMap) = execState (mapM tally $ variableFlow params) (Map.empty, Map.empty)
|
||||
defaultAssigned = Map.fromList $ map (\a -> (a, ())) $ filter (not . null) internalVariables
|
||||
defaultAssigned = Map.fromList $ map (\a -> (a, ())) $ filter (not . null) (internalVariables ++ additionalKnownVariables params)
|
||||
|
||||
tally (Assignment (_, _, name, _)) =
|
||||
modify (\(read, written) -> (read, Map.insert name () written))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue