Skip to content
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
merged 11 commits into from
Sep 12, 2024

Conversation

n1k0
Copy link
Member

@n1k0 n1k0 commented Sep 11, 2024

🔧 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.

@n1k0 n1k0 requested a review from vjousse September 11, 2024 16:18
@n1k0 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 n1k0 changed the title refactor: refactor code to have most record and constructors sorted. refactor: sort most record properties and constructors. Sep 11, 2024
Copy link
Collaborator

@vjousse vjousse left a 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 👍

@n1k0 n1k0 merged commit 1f3a6c5 into master Sep 12, 2024
6 checks passed
@n1k0 n1k0 deleted the fix/reorder-everything branch September 12, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants