Refactor to not generate Parameters twice

This commit is contained in:
Vidar Holen 2022-07-27 19:47:37 -07:00
parent 3ce310e939
commit f440912279
4 changed files with 25 additions and 27 deletions

View file

@ -35,13 +35,13 @@ analyzeScript :: AnalysisSpec -> AnalysisResult
analyzeScript spec = newAnalysisResult {
arComments =
filterByAnnotation spec params . nub $
runAnalytics spec
++ runChecker params (checkers spec params)
runChecker params (checkers spec params)
}
where
params = makeParameters spec
checkers spec params = mconcat $ map ($ params) [
ShellCheck.Analytics.checker spec,
ShellCheck.Checks.Commands.checker spec,
ShellCheck.Checks.ControlFlow.checker spec,
ShellCheck.Checks.Custom.checker,