mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Use a case expression
This commit is contained in:
parent
ec2a25a373
commit
060d94d070
@ -5096,27 +5096,28 @@ findFix reviewOptions project rule errors fixedErrors maybeModuleZipper =
|
||||
Nothing
|
||||
|
||||
Just fixablePredicate ->
|
||||
findFixHelp project fixablePredicate errors [] maybeModuleZipper
|
||||
|> Maybe.map
|
||||
(\fixResult ->
|
||||
let
|
||||
newFixedErrors : FixedErrors
|
||||
newFixedErrors =
|
||||
FixedErrors.insert fixResult.error fixedErrors
|
||||
case findFixHelp project fixablePredicate errors [] maybeModuleZipper of
|
||||
Nothing ->
|
||||
Nothing
|
||||
|
||||
nextStep : PostFixStatus
|
||||
nextStep =
|
||||
if InternalOptions.shouldContinueLookingForFixes reviewOptions newFixedErrors then
|
||||
ShouldContinue newFixedErrors
|
||||
Just fixResult ->
|
||||
let
|
||||
newFixedErrors : FixedErrors
|
||||
newFixedErrors =
|
||||
FixedErrors.insert fixResult.error fixedErrors
|
||||
|
||||
else
|
||||
ShouldAbort newFixedErrors
|
||||
in
|
||||
( nextStep, fixResult )
|
||||
|> Logger.log
|
||||
reviewOptions.logger
|
||||
(fixedError newFixedErrors { ruleName = errorRuleName fixResult.error, filePath = errorFilePath fixResult.error })
|
||||
)
|
||||
nextStep : PostFixStatus
|
||||
nextStep =
|
||||
if InternalOptions.shouldContinueLookingForFixes reviewOptions newFixedErrors then
|
||||
ShouldContinue newFixedErrors
|
||||
|
||||
else
|
||||
ShouldAbort newFixedErrors
|
||||
in
|
||||
Just ( nextStep, fixResult )
|
||||
|> Logger.log
|
||||
reviewOptions.logger
|
||||
(fixedError newFixedErrors { ruleName = errorRuleName fixResult.error, filePath = errorFilePath fixResult.error })
|
||||
|
||||
|
||||
type FindFixHelpResult
|
||||
|
Loading…
Reference in New Issue
Block a user