-
Notifications
You must be signed in to change notification settings - Fork 9
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
refactor: sort most record properties and constructors. #736
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n1k0
commented
Sep 11, 2024
n1k0
changed the title
chore: refactor code to have most record and constructors sorted.
refactor: refactor code to have most record and constructors sorted.
Sep 11, 2024
n1k0
changed the title
refactor: refactor code to have most record and constructors sorted.
refactor: sort most record properties and constructors.
Sep 11, 2024
n1k0
force-pushed
the
fix/reorder-everything
branch
from
September 12, 2024 07:58
bfe5853
to
f34c52f
Compare
n1k0
force-pushed
the
fix/reorder-everything
branch
from
September 12, 2024 08:54
f34c52f
to
316c4c0
Compare
n1k0
force-pushed
the
fix/reorder-everything
branch
from
September 12, 2024 09:45
316c4c0
to
9dccb29
Compare
vjousse
approved these changes
Sep 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work 😍 Tested locally, works as expected 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Problem
The codebase is sometimes painful to read on long pattern matching cases, long records with many properties, especially as they're not always ordered alphabetically to easily visually scan and find what you're after.
🍰 Solution
Sorting long list of things alphabetically is well known for helping seeking information in such long lists. Let's use fysiweb/elm-review-sorted to report CS violations when important files don't comply.
Note: a few modules where excluded from applying the sorted record properties rule because we're using them as constructors, so position of properties used as arguments is required at given positions in the record definition, and were so left intact.
🏝️ How to test
There's nothing to test really, as this is plain and simple code refactoring.