-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bump to latest rubocop 1.16.0 #102
Conversation
All green! |
It looks like `check_name` now knows how to call `.loc.expression` on an arugment. We were doing that on our own as well. Cleaned that up.
This gem requires 2.6+. The 2.3 in this spec is no longer supported and so it would not run.
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.
Gotta love a +3/-3 that adds this much value. Thanks for taking this on!
Probably worth updating the PR description to "Fixes #101" so merging this closes the issue automagically? |
Good call! I forgot how much I miss that kind of github magic. |
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.
Thoughts on testing this a prerelease of this version against a repo to get an idea of what might break with this upgrade?
Thoughts on updating CHANGELOG.md and the VERSION, as appropriate?
@jmpage Yes, to all. |
The prerelease testing is what blocked a new version number. I'm not sure just how breaking this is yet. |
Rails specific cops migrated out of rubocop and into rubocop-rails. Our rubocop-rails gem was behind and so it was missing those cops.
Our old code was reaching into private APIs. Lo and behold, the private APIs gated off access with `private_constant` and then renamed their methods. Found the new way to access this method by including the rspec langauge module.
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.
Thoughts on testing this on a non-ez-rails app as well, just to see how disruptive it might be?
conf/rubocop.yml
Outdated
Enabled: false | ||
|
||
Rails/ArelStar: | ||
Enabled: false | ||
|
||
Rails/Pick: | ||
Enabled: false | ||
|
||
Rails/RedundantForeignKey: | ||
Enabled: false | ||
|
||
RSpec/Capybara/CurrentPathExpectation: | ||
Enabled: false | ||
|
||
RSpec/Capybara/FeatureMethods: | ||
Enabled: false | ||
|
||
RSpec/Capybara/VisibilityMatcher: | ||
Enabled: false | ||
|
||
RSpec/EmptyHook: | ||
Enabled: false | ||
|
||
RSpec/FactoryBot/AttributeDefinedStatically: | ||
Enabled: false | ||
|
||
RSpec/FactoryBot/CreateList: | ||
Enabled: false | ||
|
||
RSpec/FactoryBot/FactoryClassName: | ||
Enabled: false | ||
|
||
RSpec/MultipleMemoizedHelpers: | ||
Enabled: false | ||
|
||
RSpec/NotToNot: | ||
Enabled: false | ||
|
||
RSpec/Rails/HttpStatus: | ||
Enabled: false | ||
|
||
RSpec/RepeatedIncludeExample: | ||
Enabled: false | ||
|
||
RSpec/StubbedMock: | ||
Enabled: false | ||
|
||
RSpec/VariableDefinition: | ||
Enabled: false | ||
|
||
RSpec/VariableName: | ||
Enabled: false | ||
|
||
Style/AccessorGrouping: | ||
Enabled: false | ||
|
||
Style/BisectedAttrAccessor: | ||
Enabled: false | ||
|
||
Style/CaseLikeIf: | ||
Enabled: false | ||
|
||
Style/CombinableLoops: | ||
Enabled: false | ||
|
||
Style/GlobalStdStream: | ||
Enabled: false | ||
|
||
Style/HashAsLastArrayItem: | ||
Enabled: false | ||
|
||
Style/HashLikeCase: | ||
Enabled: false | ||
|
||
Style/KeywordParametersOrder: | ||
Enabled: false | ||
|
||
Style/OptionalBooleanParameter: | ||
Enabled: false | ||
|
||
Style/RedundantAssignment: | ||
Enabled: false | ||
|
||
Style/RedundantRegexpCharacterClass: | ||
Enabled: false | ||
|
||
Style/RedundantRegexpEscape: | ||
Enabled: false | ||
|
||
Style/RedundantSelfAssignment: | ||
Enabled: false | ||
|
||
Style/SingleArgumentDig: | ||
Enabled: false | ||
|
||
Style/SlicingWithRange: | ||
Enabled: false | ||
|
||
Style/SoleNestedConditional: | ||
Enabled: false |
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.
Thoughts on opening an issue on this project for evaluating these for inclusion and include a checkbox TODO list in the description containing the name of each disabled cop?
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.
I definitely want to go through each of these and talk about the interesting ones. GH issues seems like a perfectly fine place to do so.
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.
I figure that GH issues let's us punt the issue of figuring out what to turn on from this PR while leaving us with a reminder to get back to it (which probably requires some deliberation for each cop).
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.
I think it's a good home for repos that don't have jira projects.
@@ -4,7 +4,7 @@ | |||
RSpec.describe RuboCop::Cop::Ezcater::StyleDig, :config do | |||
subject(:cop) { described_class.new(config) } | |||
|
|||
let(:ruby_version) { 2.3 } | |||
let(:ruby_version) { 2.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.
What prompted this change?
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.
Not gonna lie, I couldn't completely figure this one out. At least not without spending more time on it.
What I think is going on is that this cop had a minimum ruby version that it applied to. The test was making assertions about the style given a particular version. ruby_version
isn't mentioned anywhere else in the file, so I assume it's provided by rubocop, but that's where I stopped digging in.
I figured that since the gem required 2.6 or higher, we'd never be looking at a ruby lower than that. Bumping the version here fixed the spec.
CHANGELOG.md
Outdated
- Upgrade rubocop: 1.16.0 | ||
- Upgrade rubocop-rails: 2.10.1 | ||
- Upgrade rubocop-rspec: 2.3.0 | ||
- This is a major upgrade because a large number of cops have been introduced, tweaked, or renamed. |
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.
Thoughts on including (or linking to) a list of renamed cops so that people can easily update their rubocop:disable
statements?
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.
Sure. Is the changelog the appropriate home for that?
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.
It's the thing that dependabot will excerpt in a bump PR and the first place someone should look when determining changes. If the list is short, it's probably fine to include it. If it's longer, it may make sense to create a separate file in a docs/migration_guides/
folder and link to that, or link to an external resource that lives in the rubocop repos.
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.
I've rolled up the breaking changes from the three dependencies into our changelog.
@jmpage I'd be game for testing on other repos. Do you have any in mind? If not I'll just run this against whatever is checked out locally. |
05dcb5f
to
ada7d38
Compare
@sagotsky authentication-rails, identity-rails or ezcater-email-service are reasonably "simple" repos that you could test it against. |
Tested against a handful of repos. All had single digit offenses. |
🎉 Thank you @sagotsky! |
Fixes #101
What did we change?
Why are we doing this?
How was it tested?