jfmengels / elm-review-simplify

Provides elm-review rules to simplify your Elm code
https://package.elm-lang.org/packages/jfmengels/elm-review-simplify/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

Cleanup #135

Closed lue-bird closed 1 year ago

lue-bird commented 1 year ago

changes overview

As always, if you dislike how certain changes turned out in the end, say for example removing isEmptyList in favor of a case of on getListLiteral, I'll happily refactor to a consistent style you prefer.

to discuss

follow-up PR

I'd like to to overhaul error infos to common formats (those already marked TODO and many more like adding even more general checks like andThenPureChecks for the types) and polish outliers like "Unnecessary wildcard argument argument". I could add the changes them here but they probably need much more discussion and generally more time which doesn't help merging the current, unrelated changes in this PR.

I can start this PR work right after this one is merged or later depending on if you want to tweak some things after merge.

jfmengels commented 1 year ago

https://github.com/jfmengels/elm-review-simplify/pull/135/commits/9aed1dc48f7ac82cd1013135f918e1b557049c99 contained a bunch of different changes and was a bit hard to review, it would have been nice if these changes were in different commits.

Here's something I like to do: When I'm doing a change, and I then notice a different thing I should (or want to) change first, I git stash my changes so I start again with a clean slate, do my changes, commit, and then git stash pop to resume the original work. Sometimes I stack these changes and that's okay (it's actually useful, because it reminds me where I needed to continue work 😄 ). Hope this helps!

lue-bird commented 1 year ago

When I'm doing a change, and I then notice a different thing I should (or want to) change first, I git stash my changes so I start again with a clean slate, do my changes, commit, and then git stash pop

Oh, that's super helpful!

lue-bird commented 1 year ago

I know I keep adding commits for minor things but I consider this done and review-able/merge-able

jfmengels commented 1 year ago

Thank you for this extremely large and great changes! The commit story was much better in the second half, much more enjoyable to review :relaxed:

I hope you had fun doing these changes!

lue-bird commented 1 year ago

Thanks for reviewing! Did you take a look at the "to discuss" section in the PR summary?

jfmengels commented 1 year ago

Did you take a look at the "to discuss" section in the PR summary?

Oops, forgot to reply to those.

qualifyToString sounds good to me :+1:

Let's do your proposed changes for compositionChecks, I was thinking of that as well

Switching from returning a list of errors for each check to maybe one error

That sounds good to me. I guess there are very few places (if any) where we return multiple errors, right?

I can start this PR work right after this one is merged or later depending on if you want to tweak some things after merge.

Feel free to do it, I don't plan on tweaking the code at the moment.

jfmengels commented 1 year ago

Oh, you mentioned you fixed a few bugs. We should probably mention that in the CHANGELOG.md as well, and ideally write some tests if you didn't already.