-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add elm review for our elm code #446
Comments
I recommend starting with enabling the rules from You can start with
Then you'll have to fix issues. If there are too many issues, the PR diff will be very big, so it might be a pain for @harrysarson to review. I would recommend to take the configuration and comment out every rule except It DOES look like there are not too many of these issues, so running Know that you can ignore errors using ignoreErrorsForFiles and ignoreErrorsForDirectories. Once that is set up, you can take a look at adding new rules. I recommend searching through Elm packages by searching for I hope this helps! |
I'd be willing to give this one a go (I've never used elm-review, but this seems like the perfect opportunity to get acquainted with it). |
@harrysarson I'd propose a staged approach for this (essentially what @jfmengels suggested, a little bit more formalized)
What's your take on this? |
This seems like a good plan to me! Only comment other than to say go for it is:
We would not need to integrate elm-review into appveyor (if elm-review passes on linux it will on windows too). I would add elm-review to the |
This reverts commit 5552466.
Thanks to @frankschmitt points 1. and 2. from this list (#446 (comment)) are now done 🎉 A PR for step 3 would be amazing 👏 |
I'll start working on step 3 - should hopefully be pretty straightforward. |
I'm halfway through with enabling the additional Unused rules, and I've got a couple of questions about things that elm-review considers unused. Here's the first one:
It seems indeed that the arguments to UnexpectedPath are never used. However, my guess is that this was meant to reported somewhere, but instead it is discarded here:
Can we safely remove the arguments from the type constructor? And if yes, can / should we get rid of the UnexpectedPath case altogether? |
Also, elm-review complains about a couple of unused type constructors:
For testing purposes, I renamed Monochrome to Monochromex and ran the test suite. I got this error:
Ultimately, these definitions are (transitively) used by Test.Runner.Node, and I'm kind of wondering why elm-review reports them as unused. @jfmengels May this be because this module is defined as |
That sounds likely.
If you want to keep feature parity with the current version, you can safely remove it. But this might also be a sign that an error should appear. For the
The In this case, I would simply ignore that rule for the |
Both these lint rules come from package code we have inlined due to complications arising from installing extra packages. Maybe now that we use elm-json and the whole dependency resolving thing is much more solid now we could revisit these deps and see if we can un-inline them. |
For now I think ignoring the rule is probably best. |
I have a very similar situation in |
I've decided to go with the "ignore specific files" approach. This way, new source files will still automatically be checked for rule violations. |
I've decided to go with the "ignore specific files" approach. This way, new source files will still automatically be checked for rule violations. |
PR for step 3 has been submitted. I'll start working on step 4 (compiling a list of additional rules we might want to add) soon (hopefully this weekend). |
Enables the remaining Unused review rules as discussed in #446. Things to note: - a couple of files have been excluded because they're reported, but are essential for the executable to work properly (false positives, see discussion for #446) - some minor changes to the copied external modules were necessary to make elm-review happy; if we decide to re-import them in the future, we'll need to re-apply these changes. This is not the optimal solution; we should probably either try to get the upstream modules to also use elm-review and clean up unused imports etc. or exclude them from elm-review. Suggestions / feedback welcome :-)
Here's a preliminary list of packages containing review rules, categorized by how useful they seem to me at first glance: Very useful
Possibly useful
Probably not useful
Any thoughts on this? If there's no objection, I'd start integrating the packages from the top of the list. |
I cannot write instructions for this as I have never used elm-review before! First step is to workout the instructions and define our goals here.
It would be great to ensure the highest quality of our elm code.
The text was updated successfully, but these errors were encountered: