Skip to content
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

[Fix #6917] Bump Bundler dependency to >= 1.15.0 #6919

Merged
merged 1 commit into from Apr 11, 2019

Conversation

koic
Copy link
Member

@koic koic commented Apr 11, 2019

Fixes #6917.

This PR bumps Bundler dependency to >= 1.15.0.

Bundler 2 has already been released.
This PR drops old Bundler versions (1.14 or lower) to prevent the following error.

Bundler 1.14

An unexpected error occurs.

% bundle _1.14.6_ exec rubocop
bundler: failed to load command:
rubocop (/Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bin/rubocop)
TypeError: no implicit conversion of String into Integer
  /Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rubocop-0.67.1/exe/rubocop:16:in
  `<top (required)>'
  /Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bin/rubocop:23:in
  `load'
  /Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bin/rubocop:23:in
  `<top (required)>'

Bundler 1.15

Errors does not occur as expected.

% bundle _1.15.0_ exec rubocop
[Warn] Performance Cops will be removed from RuboCop 0.68. Use
rubocop-performance gem instead.
       https://github.com/rubocop-hq/rubocop/tree/master/manual/migrate_performance_cops.md

(snip)

Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

Fixes rubocop#6917.

This PR bumps Bundler dependency to >= 1.15.0.

Bundler 2 has already been released.
This PR drops old Bundler versions (1.14 or lower) to prevent the following error.

## Bundler 1.14

An unexpected error occurs.

```console
% bundle _1.14.6_ exec rubocop
bundler: failed to load command:
rubocop (/Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bin/rubocop)
TypeError: no implicit conversion of String into Integer
  /Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rubocop-0.67.1/exe/rubocop:16:in
  `<top (required)>'
  /Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bin/rubocop:23:in
  `load'
  /Users/koic/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bin/rubocop:23:in
  `<top (required)>'
```

## Bundler 1.15

Errors does not occur as expected.

```console
% bundle _1.15.0_ exec rubocop
[Warn] Performance Cops will be removed from RuboCop 0.68. Use
rubocop-performance gem instead.
       https://github.com/rubocop-hq/rubocop/tree/master/manual/migrate_performance_cops.md

(snip)
```
@bbatsov bbatsov merged commit cdf442b into rubocop:master Apr 11, 2019
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 11, 2019

Thanks!

@koic koic deleted the bump_bundler_to_1_15_0 branch April 11, 2019 07:03
@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Apr 14, 2019

Hi @koic! I don't think this PR fixes the issue.

bundler is not a runtime dependency of rubocop, so changing the development_dependency won't have any effect for end users.

What you can do is activate the version your code needs inside the rubocop executable (gem "bundler", ">= 1.15.0" or whatever), and rescue the error and give a proper message if that fails. And in the case where bundler is already loaded by the time the executable is run, check for an appropriate Bundler::VERSION.

Also, shouldn't the warning be activated only if the user is actually using performance cops?

koic added a commit to koic/rubocop that referenced this pull request Apr 17, 2019
Fixes rubocop#6939.
Fixes rubocop#6917.

This warning should not be displayed if users don't use Performance cops
as follows:

- rubocop#6845 (comment)
- rubocop#6919 (comment)

In the future, it will be better to replace it with a mechanism that
displays a warning only when the user need Performance cops.

This PR removes a warning for rubocop-performance when runinng `rubocop`
command.

It just leave a warning just to `gem install rubocop`.
https://github.com/rubocop-hq/rubocop/blob/v0.67.2/rubocop.gemspec#L47
@koic
Copy link
Member Author

koic commented Apr 17, 2019

@deivid-rodriguez Right! Thanks for your feedback.

Also, shouldn't the warning be activated only if the user is actually using performance cops?

I opened a PR #6944 that removes a warning when running rubocop command. In the future, it wll be better to replace it with a mechanism that displays a warning only when the user need Performance. Thank you, again!

bbatsov pushed a commit that referenced this pull request Apr 17, 2019
Fixes #6939.
Fixes #6917.

This warning should not be displayed if users don't use Performance cops
as follows:

- #6845 (comment)
- #6919 (comment)

In the future, it will be better to replace it with a mechanism that
displays a warning only when the user need Performance cops.

This PR removes a warning for rubocop-performance when running `rubocop`
command.

It leaves a warning just for `gem install rubocop`.
https://github.com/rubocop-hq/rubocop/blob/v0.67.2/rubocop.gemspec#L47
@deivid-rodriguez
Copy link
Contributor

No problem, thanks to you for your good work!

@agraul
Copy link

agraul commented Apr 25, 2019

Rubocop failed for older bundlers because "Bundle dependencies" were change to be a Hash instead of an Array in: rubygems/bundler@9febe9a

Fix is here:agraul@09e0a90. It may help when bringing this back only for the case the user need Performance without having to require a newer Bundler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while parsing Gemfile
4 participants