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

Recover Ruby 2.4 code analysis using TargetRubyVersion: 2.4 #288

Merged
merged 1 commit into from May 17, 2022

Conversation

koic
Copy link
Member

@koic koic commented May 15, 2022

Follow up rubocop/rubocop#10632.

Reverts #232 and e3c374b.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@koic koic force-pushed the recover_ruby_24_analysis branch from ddbdd1a to c7ba54e Compare May 15, 2022 23:13
@koic koic merged commit 11dd588 into rubocop:master May 17, 2022
@koic koic deleted the recover_ruby_24_analysis branch May 17, 2022 01:57
@deivid-rodriguez
Copy link
Contributor

Hello again @koic!

I saw that in the main repository you restored analysis support all the way back to Ruby 2.0, and here you restored Ruby 2.4 code analysis, are you planning to restore 2.3 code analysis here? Thanks so much!

@koic
Copy link
Member Author

koic commented Jun 7, 2022

@deivid-rodriguez Restoring is done up to Ruby 2.0, but I may have overlooked cops. Are there any cops found to have problems in Ruby 2.3 and lower code analysis?

@deivid-rodriguez
Copy link
Contributor

Nope, I didn't find any issues so far. My "problem" is that in RubyGems & Bundler, we still support all the way down to Ruby 2.3. So uncoupling the runtime from the target code is beneficial to us, because it allows us to upgrade RuboCop without having to drop support for Ruby 2.3 (we were locked at RuboCop 0.80.1 until now). If the same change is made to rubocop-performance, we can upgrade rubocop-performance too.

@koic
Copy link
Member Author

koic commented Jun 7, 2022

Ah, I understand! The latest RuboCop Performance is expected to be able to analyze from Ruby 2.0 to Ruby 3.1 code.
Please feel free to give me feedback if you have any problems. Thank you for your OSS maintenance!

@deivid-rodriguez
Copy link
Contributor

Oh, sorry, I recall now. I did get un-expected issues, I recall now. I got offenses about match? being preferred to =~ when using TargetRubyVersion: 2.3, even though String#match? was introduced in Ruby 2.4.

koic added a commit to koic/rubocop-performance that referenced this pull request Jun 7, 2022
Follow up rubocop#288 (comment).

This PR fixes a false positive for `Performance/RegexpMatch`
when `TargetRubyVersion: 2.3`.
@koic
Copy link
Member Author

koic commented Jun 7, 2022

I've opened #292 to resolve the false positive. I will be released soon. Please wait a moment.

@deivid-rodriguez
Copy link
Contributor

Thank you!

@koic
Copy link
Member Author

koic commented Jun 7, 2022

@deivid-rodriguez RuboCop Performance 1.14.2 has been released. Thank you too!
https://github.com/rubocop/rubocop-performance/releases/tag/v1.14.2

renawatson68 added a commit to renawatson68/performance-develop-rubyonrails that referenced this pull request Sep 23, 2022
Follow up rubocop/rubocop-performance#288 (comment).

This PR fixes a false positive for `Performance/RegexpMatch`
when `TargetRubyVersion: 2.3`.
richardstewart0213 added a commit to richardstewart0213/performance-build-Performance-optimization-analysis- that referenced this pull request Nov 4, 2022
Follow up rubocop/rubocop-performance#288 (comment).

This PR fixes a false positive for `Performance/RegexpMatch`
when `TargetRubyVersion: 2.3`.
MarttiCheng added a commit to MarttiCheng/Rubocop-Performance that referenced this pull request Sep 28, 2023
Follow up rubocop/rubocop-performance#288 (comment).

This PR fixes a false positive for `Performance/RegexpMatch`
when `TargetRubyVersion: 2.3`.
SerhiiMisiura added a commit to SerhiiMisiura/Rubocop-Performance that referenced this pull request Oct 5, 2023
Follow up rubocop/rubocop-performance#288 (comment).

This PR fixes a false positive for `Performance/RegexpMatch`
when `TargetRubyVersion: 2.3`.
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.

None yet

2 participants