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

Explain EnforceSigilOrder better in documentation #232

Closed
marknuzz opened this issue May 22, 2024 · 5 comments · Fixed by #233
Closed

Explain EnforceSigilOrder better in documentation #232

marknuzz opened this issue May 22, 2024 · 5 comments · Fixed by #233

Comments

@marknuzz
Copy link

The first thing we often get when installing rubocop-sorbet is a mass amount of requests to change the sigil ordering in files. That's a big commit, and it might cause people to ask what the significance of the ordering means. But the documentation does not provide any of this.

@andyw8
Copy link
Contributor

andyw8 commented May 22, 2024

There is no technical significance to the ordering of magic comments.

If we changed the message to "Magic comments should be in the following order for consistency", would that help?

@marknuzz
Copy link
Author

There is no technical significance to the ordering of magic comments.

If we changed the message to "Magic comments should be in the following order for consistency", would that help?

Yes, thank you for the clarification. Anything helps. Though I did find this PR here which suggests that there is in fact a technical significance at least in one case (and perhaps others?) - #120

@andyw8
Copy link
Contributor

andyw8 commented May 23, 2024

Ah, good spot. I see that RuboCop already has a cop to ensure encoding is first, so perhaps this cop should be changed to only deal with the others? Then we can simplify the explanation.

@KaanOzkan @egiurleo

@KaanOzkan
Copy link
Contributor

I think it's good for the cop to be aware of encoding. It makes it slightly harder to do an incorrectly change autocorrect logic and it shows up in the error message, helping the user: Magic comments should be in the following order: encoding, typed, warn_indent, frozen_string_literal.

But yes feel free to add a brief explanation like in Andy's comment.

@marknuzz
Copy link
Author

Thank you!

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 a pull request may close this issue.

3 participants