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:
Vidar Holen 2014-02-02 04:59:17 -08:00
parent 8ec9fa43fd
commit 76a39f254b
4 changed files with 388 additions and 377 deletions

View file

@ -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