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

Support AllCops:ActiveSupportExtensionsEnabled for Style/SymbolProc #12905

Conversation

koic
Copy link
Member

@koic koic commented May 15, 2024

Follow up d39f073.

This PR supports AllCops:ActiveSupportExtensionsEnabled instead of a TODO comment in Style/SymbolProc cop.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Follow up rubocop@d39f073.

This PR supports `AllCops:ActiveSupportExtensionsEnabled` instead of a TODO comment in `Style/SymbolProc` cop.
@bbatsov bbatsov merged commit 10cf5f0 into rubocop:master May 16, 2024
34 checks passed
@bbatsov
Copy link
Collaborator

bbatsov commented May 16, 2024

Thanks!

@koic koic deleted the change_support_active_support_extensions_enabled_for_style_symbol_proc branch May 18, 2024 15:32
@etiennebarrie
Copy link
Contributor

etiennebarrie commented May 27, 2024

I'm seeing a false positive here with CSV converters. They also check the arity of the proc, so auto-correcting from ->(x) { x.upcase } to lambda(&:upcase) breaks. I guess it's fine because the autocorrect is not safe, but just wanted to point it out in case someone else hits this.

I was able to prevent Rubocop from reporting the offense by using the ActiveSupportExtensionsEnabled configuration option: Shopify/maintenance_tasks@d24e07a. Although I don't think this applies to everybody because a Ruby gem without Active Support could hit the same issue, but my case is a Rails engine so it's fine.

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.

3 participants