-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 #12310] Drop base64
gem from runtime dependency
#12313
Merged
bbatsov
merged 1 commit into
rubocop:master
from
koic:drop_base64_gem_from_runtime_dependency
Oct 26, 2023
Merged
[Fix #12310] Drop base64
gem from runtime dependency
#12313
bbatsov
merged 1 commit into
rubocop:master
from
koic:drop_base64_gem_from_runtime_dependency
Oct 26, 2023
Conversation
This file contains 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
Fixes rubocop#12310. This PR drops `base64` gem from runtime dependency. RuboCop only uses `Base64.encode64` from the `base64` gem. Therefore, there's no need to depend on the entire `base64` gem. The implementation of `Base64.encode64` is quite simple: https://github.com/ruby/base64/blob/v0.1.1/lib/base64.rb#L27-L40 This change is a better approach that has also been adopted by rack/rack#2110.
koic
force-pushed
the
drop_base64_gem_from_runtime_dependency
branch
from
October 25, 2023 17:12
b540650
to
7399b2e
Compare
Great change! |
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this pull request
Oct 26, 2023
Follow up rubocop#12313. `base64` is not needed at runtime, but it was required as a test dependency. So, this PR suppresses the following warning when using Ruby 3.3.0dev: ```consle $ ruby -v ruby 3.3.0dev (2023-10-23T08:04:27Z master e6fcf07a6f) [x86_64-darwin22] $ cd path/to/rubocop $ bundle exec rspec /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/webmock-3.19.1/lib/webmock/util/headers.rb:3: warning: base64 which will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. ``` https://app.circleci.com/pipelines/github/rubocop/rubocop/10108/workflows/20097132-bbe3-4fa4-ad7e-de7c30c86e69/jobs/291956?invite=true#step-104-0_163 The `base64` dependency can be removed from Gemfile when bblimke/webmock#1041 is merged and released. It's a workaround until then.
bbatsov
pushed a commit
that referenced
this pull request
Oct 26, 2023
Follow up #12313. `base64` is not needed at runtime, but it was required as a test dependency. So, this PR suppresses the following warning when using Ruby 3.3.0dev: ```consle $ ruby -v ruby 3.3.0dev (2023-10-23T08:04:27Z master e6fcf07a6f) [x86_64-darwin22] $ cd path/to/rubocop $ bundle exec rspec /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/webmock-3.19.1/lib/webmock/util/headers.rb:3: warning: base64 which will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. ``` https://app.circleci.com/pipelines/github/rubocop/rubocop/10108/workflows/20097132-bbe3-4fa4-ad7e-de7c30c86e69/jobs/291956?invite=true#step-104-0_163 The `base64` dependency can be removed from Gemfile when bblimke/webmock#1041 is merged and released. It's a workaround until then.
7 tasks
This was referenced Dec 22, 2023
This was referenced Jan 2, 2024
Merged
This was referenced Jan 29, 2024
This was referenced Feb 5, 2024
koic
added a commit
to koic/rubocop-ast
that referenced
this pull request
Feb 25, 2024
This PR resolves the following CI error with RuboCop 1.35.0: ```console 1) RuboCop Project requiring all of `lib` with verbose warnings enabled emits no warnings Failure/Error: expect(warnings).to eq [] expected: [] got: ["/home/runner/work/rubocop-ast/rubocop/lib/rubocop/formatter/html_formatter.rb:6: warning: base64 wa...l no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.\n"] (compared using ==) Diff: @@ -1 +1,2 @@ +/home/runner/work/rubocop-ast/rubocop/lib/rubocop/formatter/html_formatter.rb:6: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.\n # ./spec/project_spec.rb:284:in `block (3 levels) in <top (required)>' ``` https://github.com/rubocop/rubocop-ast/actions/runs/8033104014/job/21943241393 It updates RuboCop to 1.57.2, which was finally resolved by rubocop/rubocop#12313.
koic
added a commit
to rubocop/rubocop-ast
that referenced
this pull request
Feb 25, 2024
This PR resolves the following CI error with RuboCop 1.35.0: ```console 1) RuboCop Project requiring all of `lib` with verbose warnings enabled emits no warnings Failure/Error: expect(warnings).to eq [] expected: [] got: ["/home/runner/work/rubocop-ast/rubocop/lib/rubocop/formatter/html_formatter.rb:6: warning: base64 wa...l no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.\n"] (compared using ==) Diff: @@ -1 +1,2 @@ +/home/runner/work/rubocop-ast/rubocop/lib/rubocop/formatter/html_formatter.rb:6: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.\n # ./spec/project_spec.rb:284:in `block (3 levels) in <top (required)>' ``` https://github.com/rubocop/rubocop-ast/actions/runs/8033104014/job/21943241393 It updates RuboCop to 1.57.2, which was finally resolved by rubocop/rubocop#12313.
2 tasks
This was referenced Sep 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #12310.
This PR drops
base64
gem from runtime dependency.RuboCop only uses
Base64.encode64
from thebase64
gem. Therefore, there's no need to depend on the entirebase64
gem. The implementation ofBase64.encode64
is quite simple: https://github.com/ruby/base64/blob/v0.1.1/lib/base64.rb#L27-L40This change is a better approach that has also been adopted by rack/rack#2110.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.