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

Auto-correct some Rails Rubocop violations #46793

Merged
merged 4 commits into from
Jun 10, 2022
Merged

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Jun 9, 2022

Specifically, run:

bundle exec rubocop --auto-correct --only Rails/FindById,Rails/IndexBy,Rails/RedundantForeignKey,Rails/WhereNot

Followed by:

bundle exec rubocop --auto-correct-all --only Rails/ActiveRecordAliases,Rails/ApplicationRecord,Rails/SafeNavigationWithBlank

The result of this is that the following desired rules are re-enabled:

  • Rails/ActiveRecordAliases
  • Rails/ApplicationRecord
  • Rails/FindById
  • Rails/IndexBy
  • Rails/SafeNavigationWithBlank
  • Rails/RedundantForeignKey
  • Rails/WhereNot

We also incidentally re-enable the Lint/Debugger rule. Not sure why this one was disabled in the first place, but I'm glad to see it gone!

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Hamms added 2 commits June 9, 2022 14:31
    bundle exec rubocop --auto-correct --only Rails/ActiveRecordAliases,Rails/ApplicationMailer,Rails/ApplicationRecord,Rails/FindById,Rails/IndexBy,Rails/RedundantForeignKey,Rails/SafeNavigationWithBlank,Rails/WhereNot
    bundle exec rubocop --auto-correct --only Layout/SpaceInsideHashLiteralBraces,Rails/ApplicationRecord,Style/SymbolProc
@Hamms Hamms changed the title More rubocop rails fixes Auto-correct some Rails Rubocop violations Jun 9, 2022
Hamms added 2 commits June 9, 2022 14:57
…ationRecord,Rails/FindById,Rails/IndexBy,Rails/RedundantForeignKey,Rails/SafeNavigationWithBlank,Rails/WhereNot
@Hamms Hamms added Rails Upgrade All work related to upgrading the version of Ruby on Rails we use. code-hygiene labels Jun 9, 2022
@Hamms Hamms marked this pull request as ready for review June 10, 2022 01:44
@Hamms Hamms requested a review from a team as a code owner June 10, 2022 01:44
@Hamms Hamms requested a review from a team June 10, 2022 01:46
@Hamms Hamms merged commit 5f25a42 into staging Jun 10, 2022
@Hamms Hamms deleted the more-rubocop-rails-fixes branch June 10, 2022 17:02
@Hamms Hamms mentioned this pull request Jun 10, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-hygiene Rails Upgrade All work related to upgrading the version of Ruby on Rails we use.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants