mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 22:38:50 +08: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:
@@ -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
|
||||
|
Reference in New Issue
Block a user