Speed up review

This commit is contained in:
Jeroen Engels 2022-09-17 18:53:41 +02:00
parent 07767a2be5
commit 0d944f581f

View File

@ -467,14 +467,14 @@ review rules project =
Project { p | moduleNameLookupTables = moduleNameLookupTables }
in
if not (List.isEmpty scopeResult.errors) then
( List.map errorToReviewError scopeResult.errors, rules )
( ListExtra.orderIndependentMap errorToReviewError scopeResult.errors, rules )
else
runRules rules projectWithLookupTable sortedModules
|> Tuple.mapFirst (List.map errorToReviewError)
|> Tuple.mapFirst (ListExtra.orderIndependentMap errorToReviewError)
modulesThatFailedToParse ->
( List.map parsingError modulesThatFailedToParse, rules )
( ListExtra.orderIndependentMap parsingError modulesThatFailedToParse, rules )
{-| Review a project and gives back the errors raised by the given rules.