-
Notifications
You must be signed in to change notification settings - Fork 375
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
Run Rubocop in parallel with tests #842
Conversation
Might we want to run it for each version of Ruby? It's possible that different versions of Ruby have different rules, specific to features they implement. Ideally this would never happen, but it has been the case where we've done Ruby version specific patching before. |
@delner that makes sense. I can test this on all version we support and report back. |
@delner I double checked and because we specify To make sure all was true for our project, I ran With this in mind, I think it's best to run the latest version of Rubocop, keeping a fixed |
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.
Moving linting into its own step is fine. Just one comment; address or merge at your discretion.
.circleci/config.yml
Outdated
<<: *config-2_6 | ||
name: lint | ||
requires: | ||
- build-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.
Only concern here is the linting rules for 2.6 might be different than other versions (e.g. new syntax is introduced that is preferred to older versions.) This concern generally applies moving forward to all versions of Ruby, as the same thing could happen in any future version.
Not a huge deal to me, just a potential gap I see.
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.
Setting TargetRubyVersion
to 2.1
, like we do, prevents Rubocop from considering any rules created for versions greater than 2.1
.
Effectively we "locked" Rubocop in the 2.1
era for cops.
Also, we are locked to a specific version of Rubocop, 0.49.1
, so that gem's code is always consistent for us.
@delner, I've rebased this PR with |
@marcotc Can you rebase this again? I'll approve and merge then. |
Done, thank you @delner! |
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.
👍
We only need to run
rubocop
once in our CI, but today we run it for each Ruby version, serially with tests. This slows down total CI time by ~26s.It also gives us a clearer view of what failed (tests or linting?), as today lint failures will get reported as test failures.
This PR moves
rubocop
to a separatelint
step.This step runs in parallel with all
test
s and is a required step fordeploy prerelease Gem
anddeploy release
steps.