Skip to content

Commit

Permalink
DEBUG: ADD UNUSED TYPE
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmengels committed Nov 30, 2024
1 parent f243736 commit 98710f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Review/Error.elm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type ErrorFixes
= NoFixes
| Available (Dict String ( Target, List Fix ))
| FailedToApply FixProblem.FixProblem
| Unused FixProblem.FixProblem


fixesFromMaybe : String -> Maybe (List Fix) -> ErrorFixes
Expand Down
12 changes: 12 additions & 0 deletions src/Review/Rule.elm
Original file line number Diff line number Diff line change
Expand Up @@ -4430,6 +4430,9 @@ errorFixes (Review.Error.ReviewError err) =
Review.Error.FailedToApply _ ->
Nothing

Review.Error.Unused _ ->
Nothing


{-| Get the reason why the fix for an error failed when its available automatic fix was attempted and deemed incorrect.
Expand Down Expand Up @@ -4457,6 +4460,9 @@ errorFixFailure (Review.Error.ReviewError err) =
FixProblem.HasCollisionsInFixRanges ->
Fix.HasCollisionsInFixRanges

Review.Error.Unused _ ->
Nothing


{-| Get the file path of an [`Error`](#Error).
-}
Expand Down Expand Up @@ -4781,6 +4787,9 @@ qualifyError params (Error err) acc =

Review.Error.FailedToApply _ ->
err.fixes

Review.Error.Unused _ ->
err.fixes
}

else
Expand Down Expand Up @@ -5941,6 +5950,9 @@ isFixable predicate (Error err) =
Review.Error.FailedToApply _ ->
Nothing

Review.Error.Unused _ ->
Nothing


applySingleModuleFix : ValidProject -> Maybe (Zipper (Graph.NodeContext FilePath ())) -> Error {} -> String -> List InternalFix.Fix -> Result (Error {}) { project : ValidProject, fixedFile : FixedFile }
applySingleModuleFix project maybeModuleZipper ((Error headError) as err) targetPath fixes =
Expand Down
3 changes: 3 additions & 0 deletions src/Review/Test.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,9 @@ checkFixesAreCorrect (Review.Project.Internal.Project project) ((Error.ReviewErr
Error.FailedToApply fixProblem ->
Expect.fail <| FailureMessage.fixProblem_ fixProblem error_

Error.Unused _ ->
Expect.pass


checkFixesMatch : ProjectInternals -> ReviewError -> Dict String String -> List ( String, ( Error.Target, List Fix ) ) -> Expectation
checkFixesMatch project error_ expectedFixed fixes =
Expand Down

0 comments on commit 98710f8

Please sign in to comment.