jfmengels / elm-review

Analyzes Elm projects, to help find mistakes before your users find them.
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
Other
252 stars 13 forks source link

Apply fixes found in the result cache #150

Closed jfmengels closed 1 year ago

jfmengels commented 1 year ago

This change tries to apply fixes from errors found in the result cache. That means that even if we reuse the cache for a given module, we will try to find fixes. This is annoying for performance, but (so far at least) necessary because when the cache comes directly from the file system, we have never gone through the errors.

Basically, this PR solves the following issue:

$ elm-review --fix-all
# Found 10 fixable errors
<exit before accepting the fix>
$ elm-review --fix-all
I found no issues.

While developing this change, I created additional bugs because I forgot to update the ContentHash in ProjectModule (which happen to never cause problems, I think, before this change). To prevent this from happening again, I made ProjectModule opaque.