mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Refactoring, 25% speedup.
* Checks now use Writer monad instead of State * Parser no longer emits notes unrelated to parsing. * All checks are now passed a parameter value, containing shell type, map from notes to parents and such. This eliminates recalculation and removes the need for a special group of parent examining checks.
This commit is contained in:
parent
8ec9fa43fd
commit
76a39f254b
4 changed files with 388 additions and 377 deletions
|
@ -44,9 +44,9 @@ shellCheck :: String -> [ShellCheckComment]
|
|||
shellCheck script =
|
||||
let (ParseResult result notes) = parseShell "-" script in
|
||||
let allNotes = notes ++ (concat $ maybeToList $ do
|
||||
(tree, map) <- result
|
||||
let newMap = runAllAnalytics tree map
|
||||
return $ notesFromMap $ filterByAnnotation tree newMap
|
||||
(tree, posMap) <- result
|
||||
let list = runAnalytics [] tree
|
||||
return $ map (noteToParseNote posMap) $ filterByAnnotation tree list
|
||||
)
|
||||
in
|
||||
map formatNote $ nub $ sortNotes allNotes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue