-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
fix: pin rubocop to 1.12 due to error with ruby 2.4 #8651
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rubocop 1.13 was released today (2021-04-20) and it has dropped support for Ruby 2.4[1][2]. This causes rubocop to die on the spot when trying to run it: $ bundle exec rubocop --version 1.13.0 $ bundle exec rubocop Error: RuboCop found unsupported Ruby version 2.4 in `TargetRubyVersion` parameter (in .rubocop.yml). 2.4-compatible analysis was dropped after version 1.12. Supported versions: 2.5, 2.6, 2.7, 3.0 And thus the "style_check" ci job is currently broken[3]. Rubocop 1.10 and 1.11 don't work either because of a rename: $ bundle exec rubocop Error: unrecognized cop Style/StringChars found in .rubocop.yml Did you mean `Style/StringMethods`? The latter and arguably the former are breaking changes on minor versions, which means that rubocop does not follow semantic versioning[4][5]. Additionally, the gem was already pinned on a minor version on commit fe64d98 ("style: add rubocop 1.9 cops (jekyll#8567)"), but commit c9c9dc7 ("chore(deps): rubocop 1.10") pinned it only on the major version (see also issue jekyll#8583)[6]. This back-and-forth happened more than once: * 2016-10-18: nil to "~> 0.44.1" on commit cc19728 ("Restrict Rubocop version") * 2017-01-14: "~> 0.44.1" to "~> 0.46" on commit 4432482 ("bump Rubocop to latest version") * 2017-03-28: "~> 0.47" to "~> 0.47.1" on commit 86703f1 ("Use Rubocop v0.47.1 till we're ready for v0.48") * 2020-10-21: "~> 0.93.0" to "~> 1.0" on commit 1ae2a1d ("Bump RuboCop to v1.x") * 2021-01-31: "~> 1.0" to "~> 1.8.1" on commit d460fae ("Pin rubocop version (jekyll#8564)") * 2021-02-19: "~> 1.9.1" to "~> 1.10" on commit c9c9dc7 ("chore(deps): rubocop 1.10") The above can be checked with one of the following commands: $ tig '-G"rubocop"' -- Gemfile # or $ git log -p '-G"rubocop"' -- Gemfile So pin rubocop back on a minor version: the 1.12 series. Example of another project doing something similar (found on [2]): Shopify/job-iteration[7]. Fixes jekyll#8649. [1] https://github.com/rubocop/rubocop/releases/tag/v1.13.0 [2] rubocop/rubocop#9648 [3] jekyll#8649 [4] https://semver.org/ [5] rubocop/rubocop#4243 [6] https://guides.rubygems.org/patterns/#declaring-dependencies [7] Shopify/job-iteration#79
kmk3
added a commit
to kmk3/jekyll
that referenced
this pull request
Apr 23, 2021
$ ./script/fmt --disable-pending-cops RuboCop 1.12.1 Inspecting 134 files .W.................................................................................................................................... Offenses: lib/jekyll/cache.rb:166:5: W: [Correctable] Lint/RedundantCopDisableDirective: Unnecessary disabling of Security/MarshalLoad. # rubocop:disable Security/MarshalLoad ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 134 files inspected, 1 offense detected, 1 offense auto-correctable Try running `script/fmt -a` to automatically fix errors Relates to jekyll#8651.
Merged
DirtyF
approved these changes
May 14, 2021
@jekyll: merge +fix |
jekyllbot
added a commit
that referenced
this pull request
May 14, 2021
github-actions bot
pushed a commit
that referenced
this pull request
May 14, 2021
Kelvin M. Klann: fix: pin rubocop to 1.12 due to error with ruby 2.4 (#8651) Merge pull request 8651
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a 🐛 bug fix.
Summary
Rubocop 1.13 was released today (2021-04-20) and it has dropped support
for Ruby 2.4[1][2]. This causes rubocop to die on the spot when
trying to run it:
And thus the "style_check" ci job is currently broken[3].
Rubocop 1.10 and 1.11 don't work either because of a rename:
The latter and arguably the former are breaking changes on minor
versions, which means that rubocop does not follow semantic
versioning[4][5]. Additionally, the gem was already pinned on a minor
version on commit fe64d98 ("style: add rubocop 1.9 cops (#8567)"), but
commit c9c9dc7 ("chore(deps): rubocop 1.10") pinned it only on the
major version (see also issue #8583)[6]. This back-and-forth happened
more than once:
The above can be checked with one of the following commands:
So pin rubocop back on a minor version: the 1.12 series.
Example of another project doing something similar (found on [2]):
Shopify/job-iteration[7].
Fixes #8649.
[1] https://github.com/rubocop/rubocop/releases/tag/v1.13.0
[2] rubocop/rubocop#9648
[3] #8649
[4] https://semver.org/
[5] rubocop/rubocop#4243
[6] https://guides.rubygems.org/patterns/#declaring-dependencies
[7] Shopify/job-iteration#79
Context
See #8649.