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

Exclude sorbet assignments from Style/MutableConstant cop #18091

Closed
wants to merge 5 commits into from

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Aug 19, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

We can't do anything about these violations, and the rubocop:disable comments are a bit of an eyesore. How would folks feel about excluding such patterns from the Style/MutableConstant cop instead? (If folks are amenable, I can then flesh this out with tests and such.)

@dduugg dduugg marked this pull request as draft August 19, 2024 22:35
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Approach makes sense to me, thanks!

@Bo98
Copy link
Member

Bo98 commented Aug 20, 2024

Good idea. Though might be worth considering upstreaming this to rubocop-sorbet which also has a Style/MutableConstant extension? T::Enum is another case (though not one used by Homebrew/brew yet).

@dduugg
Copy link
Member Author

dduugg commented Aug 20, 2024

Good idea. Though might be worth considering upstreaming this to rubocop-sorbet which also has a Style/MutableConstant extension? T::Enum is another case (though not one used by Homebrew/brew yet).

Great suggestion, I've opened Shopify/rubocop-sorbet#256
I don't understand the T::Enum case (I've only used it as a superclass), so I didn't include a pattern for that one.

@Bo98
Copy link
Member

Bo98 commented Aug 20, 2024

Great suggestion, I've opened Shopify/rubocop-sorbet#256 I don't understand the T::Enum case (I've only used it as a superclass), so I didn't include a pattern for that one.

See https://github.com/Homebrew/ci-orchestrator/blob/f643ab875fbd9695072333fe2de17c98eb98cd8a/src/priority_type.rb as an example

@dduugg
Copy link
Member Author

dduugg commented Aug 20, 2024

Closing this, pending outcome of upstream PR

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.

4 participants