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

Update dependencies and correct rubocop failure #7371

Merged
merged 10 commits into from Jan 11, 2024
Merged

Update dependencies and correct rubocop failure #7371

merged 10 commits into from Jan 11, 2024

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Jan 10, 2024

What was the end-user or developer problem that led to this PR?

In Ruby 3.3/3.4, bin/rubocop show the following warning.

$ bin/rubocop -A
/Users/hsbt/.local/share/gem/gems/rubocop-1.52.1/lib/rubocop/formatter/html_formatter.rb:3: warning: base64 was loaded from the standard library, but is not part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. Also contact author of rubocop-1.52.1 to add base64 into its gemspec.

It fixed at recent released version of rubocop.

What is your fix for the problem, implemented in this PR?

I updated tool/bundler/*.lock and run bin/rubocop -A each cop rule.

Make sure the following tasks are checked

@@ -282,7 +282,7 @@ def match_platforms?(platform, platforms)

# On universal Rubies, resolve the "universal" arch to the real CPU arch, without changing the extension directory.
class BasicSpecification
if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
if /^universal\.(?<arch>.*?)-/ =~ CROSS_COMPILING || RUBY_PLATFORM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a false positive in RuboCop. I've opened PR rubocop/rubocop#12607, but until that is resolved, it'll need to prevent false detections by using # rubocop:disable Style/RedundantParentheses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your input!

@hsbt hsbt enabled auto-merge January 11, 2024 00:47
@hsbt hsbt merged commit 8c6b6bc into master Jan 11, 2024
82 checks passed
@hsbt hsbt deleted the update-deps branch January 11, 2024 02:30
@deivid-rodriguez
Copy link
Member

@hsbt As per #7371 (comment), we may want to start using bin/rubocop -a when autocorrect and limit autocorrection to safe cops? To be honest, I always thought (until now) that -A was the "safe autocorrect" flag and -a was the unsafe one.

@koic
Copy link
Contributor

koic commented Jan 17, 2024

This is a piece of trivia and can be remembered in the same way as git branch -d and git branch -D :-)
rubocop/rubocop#8156 (comment)

@deivid-rodriguez
Copy link
Member

deivid-rodriguez commented Jan 17, 2024

Makes sense, I guess the meaning was changed in v1, and that's why I thought -a corrected everything?

@koic
Copy link
Contributor

koic commented Jan 17, 2024

I see. The concept of safety was not present initially, and there was only -a, which indeed is what -A is now 😅

@hsbt
Copy link
Member Author

hsbt commented Jan 18, 2024

oh, I didn't know difference of -a and -A. Thanks.

I will use -a instead of -A in further works.

deivid-rodriguez pushed a commit that referenced this pull request Mar 20, 2024
Update dependencies and correct rubocop failure

(cherry picked from commit 8c6b6bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants