-
-
Notifications
You must be signed in to change notification settings - Fork 751
Generate rubocop_todo.yml #2506
Conversation
|
||
Layout/SpaceBeforeBlockBraces: | ||
EnforcedStyle: space | ||
EnforcedStyleForEmptyBraces: space |
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.
CI failed on rubocop
linting in the first commit for 2 reasons. The 1st is resolved by this change. The EnforcedStyleForEmptyBraces
configuration was defaulting to no_space
when this codebase uses space
.
.rubocop_todo.yml
Outdated
# Offense count: 1 | ||
# Configuration parameters: CountKeywordArgs. | ||
Metrics/ParameterLists: | ||
Max: 6 |
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.
The second was this. There is one other place in the codebase that uses 6 method parameters. Since the todo detected this and raised the overall Max
, the inline whitelisting became unneeded. Regenerating the todo reveals that the deletion I made raised the Offense count
to 2
.
Unfortunately, Metrics
cops do not list exclusions the way all the other cop types do. So this is undesirable. I'll see if I can find the other offense and inline disable it.
ee57e0c
to
2a7e6d3
Compare
Thank you! I was the one who upgraded us. I'm not quite sure I follow what's going on here - how I thought things were set up was that we have a list of global ignores in Does that match with your conception of how things are put together? |
Thanks for the fast feedback! The I am confused why CI wasn't picking up offenses that were not specified in either of the two current Hmm. One other example is that my UPDATEThe If the A thought on all the Based on the revelation that rubocop is only run against
It does now :). |
I'm not really sure the history behind excluding
tl;dr I haven't finished the upgrade :) It was a PITA getting the upgrade done against all repos, I tried to keep them in sync and then intended to do a "final"
In general we've preferred to have "minimal" cop support, so only enable ones we particularly cared about. This isn't a strongly held project preference though I don't think. The upgrade introduced a huge number of new cops, so for expediency I basically defaulted to disabling them (i.e. I preferenced "get upgrade done" over "incorporate new cops that might be useful". Motivation for the upgrade was the recent CVE.)
Thank you for the clarification, sorry that it was confusing :( |
You know what, having a |
My suggestion about having a second AllCops:
Exclude:
- 'spec/**/*' Doing so would allow the linting to catch all the Ruby files in I'll throw up another commit up or two that excludes all the Metrics cops in |
928abed
to
d9b142c
Compare
Besides what appears to be a fluke, but consistent, |
d9b142c
to
f5b7390
Compare
Instead of inline using rubocop:disable on offending lines, this change follows the repo's convention of excluding files. This change also accounts for files generated during testing.
f5b7390
to
5fe4c05
Compare
Let me know if you'd like me to reopen, or do any |
This PR adds a
rubocop_todo.yml
file to root. This file was generated using the--auto-gen-config
flag. This file can be leveraged to understand areas for "improvement" in the application code, and provide an easier path towards resolving offenses.No worries if this is not something the
rspec-core
team wants to include. I noticed you recently upgraded to the most recent version ofRuboCop
.If this is accepted, there are a few steps I'd recommend come next.
cop
Departments
intorubocop_rspec_base.yml
file. So instead of justMethodLength
, this would beMetrics/MethodLength
.rubocop
config files to make it more user friendly when looking up your linting conventions. This also makes it easier to cross reference.false
s and then regenerating thistodo
file presents a clear view of the current state of the project (in the view ofrubocop
, of course). I've found it had to make decisions about these all at once because there are 300+ cops with granular configurations. Often there is a setting for acop
that is preferable to disabling it. Not always though :).--auto-correct
when possible.Happy to do any of these things in follow up PRs. Also happy if you decide this doesn't sound like a good direction for the repo and this PR is closed :) .