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
.rubocop.yml: selectively enable Rails cops #12567
Conversation
Review period ended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, thanks @Bo98. I wonder if we can just unconditionally disable these Rails
cops and only enable those we find specifically useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
After a quick glance at the Rails cops, I agree that it looks like most can be removed completely. Off the top of my head, I know we definitely want to keep Rails/Blank
, Rails/Presence
, and Rails/Present
. There might be others, but if I had to guess those three are the main reason we use any Rails cops (unless they come by default which might be the case)
|
80694f8
to
bff3070
Compare
We should monitor the changelog in rubocops-rails Dependabot PRs to see what new cops should be added. |
bff3070
to
a6a6350
Compare
a6a6350
to
246d086
Compare
Thanks @Bo98! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Some Rails cops use
ActiveRecordHelper
which contains a cache checksum that involves checksuming a Rails database schema. This involves an amount of file traversal as it tries to find this schema, which can be slow.For cached
brew style
runs on Homebrew/core, disabling these cops speeds up execution time by over 50%.