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

Fix method order in the Mixin Grouping section #926

Closed
wants to merge 1 commit into from

Conversation

ydakuka
Copy link
Contributor

@ydakuka ydakuka commented Oct 29, 2023

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rubocop repo comment says we should not change the order to avoid behaviour change.

Here, we also shouldn’t create an impression that we insist on alphabetical or any ordering.
And the Bar, Foo order feels extremely unnatural and no doubt steals focus from the guideline in question.

I don’t think it makes sense to introduce a rule to sort includes. It would be a nightmare to have all exceptions marked with rubocop:disable.

@ydakuka
Copy link
Contributor Author

ydakuka commented Oct 29, 2023

The rubocop repo comment says we should not change the order to avoid behaviour change.

Ok, should the PR (#924) be reverted?

@pirj
Copy link
Member

pirj commented Oct 29, 2023

No. Kwargs ordering had a clear inconsistency ‘bar’ was a required kwarg as specified in the “bad” example. It should have remained such in the ‘good’ example. This has nothing to do with alphabetic ordering of kwargs.

In any case, kwargs ordering change is cosmetic, while module inclusion order change can cause behaviour change.
Having a alphabetic order is in some cases impossible, and would force users to face hard to track bugs, and in the end inline disable the cop for certain order-sensitive includes.

I’ll close this unless the community has a strong preference for alphabetic order

@pirj pirj closed this Oct 29, 2023
@ydakuka ydakuka deleted the fix-order-in-mixin-grouping branch October 29, 2023 16:07
@ydakuka
Copy link
Contributor Author

ydakuka commented Oct 29, 2023

Got it, thanks for the explanation.

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