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

Bump rubocop from 1.56.4 to 1.57.1 #582

Merged
merged 3 commits into from Dec 11, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 16, 2023

Bumps rubocop from 1.56.4 to 1.57.1.

Release notes

Sourced from rubocop's releases.

RuboCop 1.57.1

Bug fixes

  • #12271: Fix a false positive for Lint/RedundantSafeNavigation when using snake case constant receiver. (@​koic)
  • #12265: Fix an error for Layout/MultilineMethodCallIndentation when usingarithmetic operation with block inside a grouped expression. (@​koic)
  • #12177: Fix an incorrect autocorrect for Style/RedundantException. (@​ydah)
  • #12261: Fix an infinite loop for Layout/MultilineMethodCallIndentation when multiline method chain with a block argument and method chain. (@​ydah)
  • #12263: Fix false positives for Style/RedundantDoubleSplatHashBraces when method call for no hash braced double splat receiver. (@​koic)
  • #12262: Fix an incorrect autocorrect for Style/RedundantDoubleSplatHashBraces when using double splat hash braces with merge method call twice. (@​koic)

RuboCop 1.57

New features

  • #12227: Add new Style/SingleLineDoEndBlock cop. (@​koic)
  • #12246: Make Lint/RedundantSafeNavigation aware of constant receiver. (@​koic)
  • #12257: Make Style/RedundantDoubleSplatHashBraces aware of merge methods. (@​koic)

Bug fixes

  • #12244: Fix a false negative for Lint/Debugger when using debugger method inside block. (@​koic)
  • #12231: Fix a false negative for Metrics/ModuleLength when defining a singleton class in a module. (@​koic)
  • #12249: Fix a false positive Style/IdenticalConditionalBranches when if..else with identical leading lines and assign to condition value. (@​koic)
  • #12253: Fix Lint/LiteralInInterpolation to accept an empty string literal interpolated in words literal. (@​knu)
  • #12198: Fix an error for flip-flop with beginless or endless ranges. (@​koic)
  • #12259: Fix an error for Lint/MixedCaseRange when using nested character class in regexp. (@​koic)
  • #12237: Fix an error for Style/NestedTernaryOperator when a ternary operator has a nested ternary operator within an if. (@​koic)
  • #12228: Fix false negatives for Style/MultilineBlockChain when using multiline block chain with safe navigation operator. (@​koic)
  • #12247: Fix false negatives for Style/RedundantParentheses when using logical or comparison expressions with redundant parentheses. (@​koic)
  • #12226: Fix false positives for Layout/MultilineMethodCallIndentation when aligning methods in multiline block chain. (@​koic)
  • #12076: Fixed an issue where the top-level cache folder was named differently during two consecutive rubocop runs. (@​K-S-A)

Changes

  • #12235: Enable auto parallel inspection when config file is specified. (@​aboutNisblee)
  • #12234: Enhance Style/FormatString's autocorrection when using known conversion methods whose return value is not an array. (@​koic)
  • #12128: Make Style/GuardClause aware of define_method. (@​koic)
  • #12126: Make Style/RedundantFilterChain aware of select.present? when ActiveSupportExtensionsEnabled config is true. (@​koic)
  • #12250: Mark Lint/RedundantRequireStatement as unsafe autocorrect. (@​koic)
  • #12097: Mark unsafe autocorrect for Style/ClassEqualityComparison. (@​koic)
  • #12210: Mark Style/RedundantFilterChain as unsafe autocorrect. (@​koic)
Changelog

Sourced from rubocop's changelog.

1.57.1 (2023-10-13)

Bug fixes

  • #12271: Fix a false positive for Lint/RedundantSafeNavigation when using snake case constant receiver. ([@​koic][])
  • #12265: Fix an error for Layout/MultilineMethodCallIndentation when usingarithmetic operation with block inside a grouped expression. ([@​koic][])
  • #12177: Fix an incorrect autocorrect for Style/RedundantException. ([@​ydah][])
  • #12261: Fix an infinite loop for Layout/MultilineMethodCallIndentation when multiline method chain with a block argument and method chain. ([@​ydah][])
  • #12263: Fix false positives for Style/RedundantDoubleSplatHashBraces when method call for no hash braced double splat receiver. ([@​koic][])
  • #12262: Fix an incorrect autocorrect for Style/RedundantDoubleSplatHashBraces when using double splat hash braces with merge method call twice. ([@​koic][])

1.57.0 (2023-10-11)

New features

  • #12227: Add new Style/SingleLineDoEndBlock cop. ([@​koic][])
  • #12246: Make Lint/RedundantSafeNavigation aware of constant receiver. ([@​koic][])
  • #12257: Make Style/RedundantDoubleSplatHashBraces aware of merge methods. ([@​koic][])

Bug fixes

  • #12244: Fix a false negative for Lint/Debugger when using debugger method inside block. ([@​koic][])
  • #12231: Fix a false negative for Metrics/ModuleLength when defining a singleton class in a module. ([@​koic][])
  • #12249: Fix a false positive Style/IdenticalConditionalBranches when if..else with identical leading lines and assign to condition value. ([@​koic][])
  • #12253: Fix Lint/LiteralInInterpolation to accept an empty string literal interpolated in words literal. ([@​knu][])
  • #12198: Fix an error for flip-flop with beginless or endless ranges. ([@​koic][])
  • #12259: Fix an error for Lint/MixedCaseRange when using nested character class in regexp. ([@​koic][])
  • #12237: Fix an error for Style/NestedTernaryOperator when a ternary operator has a nested ternary operator within an if. ([@​koic][])
  • #12228: Fix false negatives for Style/MultilineBlockChain when using multiline block chain with safe navigation operator. ([@​koic][])
  • #12247: Fix false negatives for Style/RedundantParentheses when using logical or comparison expressions with redundant parentheses. ([@​koic][])
  • #12226: Fix false positives for Layout/MultilineMethodCallIndentation when aligning methods in multiline block chain. ([@​koic][])
  • #12076: Fixed an issue where the top-level cache folder was named differently during two consecutive rubocop runs. ([@​K-S-A][])

Changes

  • #12235: Enable auto parallel inspection when config file is specified. ([@​aboutNisblee][])
  • #12234: Enhance Style/FormatString's autocorrection when using known conversion methods whose return value is not an array. ([@​koic][])
  • #12128: Make Style/GuardClause aware of define_method. ([@​koic][])
  • #12126: Make Style/RedundantFilterChain aware of select.present? when ActiveSupportExtensionsEnabled config is true. ([@​koic][])
  • #12250: Mark Lint/RedundantRequireStatement as unsafe autocorrect. ([@​koic][])
  • #12097: Mark unsafe autocorrect for Style/ClassEqualityComparison. ([@​koic][])
  • #12210: Mark Style/RedundantFilterChain as unsafe autocorrect. ([@​koic][])
Commits
  • 9141fe5 Cut 1.57.1
  • a302d0c Update Changelog
  • 12016d8 [Fix #12271] Fix a false positive for Lint/RedundantSafeNavigation
  • 128618c Fix false positives for Style/RedundantDoubleSplatHashBraces
  • 03cdf04 Merge pull request #12267 from ydah/fix/12261
  • 7edb5ca [Fix #12261] Fix an infinite loop for Layout/MultilineMethodCallIndentation
  • 42898bc Merge pull request #12266 from koic/fix_an_error_for_layout_multiline_method_...
  • a4a505d [Fix #12265] Fix an error for Layout/MultilineMethodCallIndentation
  • 84840b8 Fix typos
  • 873cb9f Fix an incorrect autocorrect for Style/RedundantException when message is n...
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot requested a review from a team as a code owner October 16, 2023 15:58
@dependabot dependabot bot added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Oct 16, 2023
@dependabot dependabot bot force-pushed the dependabot/bundler/rubocop-1.57.1 branch from e2becba to 4de71fd Compare October 16, 2023 15:58
@github-actions github-actions bot added the config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops label Oct 22, 2023
Comment on lines +797 to +802
<% if rubocop_version >= Gem::Version.new('1.57') %>
Style/SingleLineDoEndBlock:
Enabled: true
<% end %>
Copy link
Contributor

Choose a reason for hiding this comment

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

@rafaelfranca Trying something new here.

Typically, when a new cop is released, we enable or disable it, but that requires bumping the minimum RuboCop version (as older versions will complain they don't know about that cop).

As per our discussion about plugins, we'll have to take this approach to selectively enable plugin cops, as we won't be able to rely on Bundler/Rubygems to enforce any version requirement (without adding a dependency from rubocop-shopify to the various plugins, which we don't want to do).

Therefore, I'm trying out this approach here first.

Note that rubocop-shopify.gemspec has not changed, and CI is passing across all versions tested.

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Oct 30, 2023

A newer version of rubocop exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@@ -1,3 +1,5 @@
<% rubocop_version = Gem.loaded_specs.fetch("rubocop").version %>
Copy link
Member

Choose a reason for hiding this comment

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

Is this the version on the bundle or in the system?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the version of whatever the process is running, depending on if bundle exec (or equivalent binstub) is used or not.

Added logging and binstub

% git diff -U1
diff --git a/rubocop.yml b/rubocop.yml
index aab03ce..99bae8c 100644
--- a/rubocop.yml
+++ b/rubocop.yml
@@ -1,2 +1,4 @@
 <% rubocop_version = Gem.loaded_specs.fetch("rubocop").version %>
+<% puts "RUBOCOP VERSION:          #{rubocop_version}" %>
+<% puts "RUBOCOP-MINITEST VERSION: #{Gem.loaded_specs["rubocop-minitest"]&.version}" %>
% bundle binstubs rubocop

bundle info

% bundle info rubocop | grep '*'
  * rubocop (1.57.1)
% bundle info rubocop-minitest
Could not find gem 'rubocop-minitest'.

gem info rubocop

% bundle exec gem info rubocop | grep '^rubocop'
rubocop (1.57.1)
% gem info rubocop | grep '^rubocop' 
rubocop (1.57.2, 1.57.1, 1.56.4, 1.56.3, 1.56.2, 1.56.1, 1.55.1, 1.54.2, 1.54.1, 1.52.1, 1.52.0, 1.50.2, 1.50.0, 1.49.0, 1.30.1)

gem info rubocop-minitest

% bundle exec gem info rubocop-minitest | grep '^rubocop'
% gem info rubocop-minitest | grep '^rubocop' 
rubocop-minitest (0.32.2, 0.31.0)

Running rubocop

% bundle exec rubocop | grep VERSION
RUBOCOP VERSION:          1.57.1
RUBOCOP-MINITEST VERSION: 
% bin/rubocop | grep VERSION
RUBOCOP VERSION:          1.57.1
RUBOCOP-MINITEST VERSION: 
% rubocop | grep VERSION
RUBOCOP VERSION:          1.57.2
RUBOCOP-MINITEST VERSION: 

dependabot bot and others added 3 commits December 11, 2023 14:50
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.4 to 1.57.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.56.4...v1.57.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This automated commit dumps the contents of the full RuboCop config.
[dependabot skip]
This enables `Style/SingleLineDoEndBlock` for consumers on a new enough
version of RuboCop. This allows us to enable the cop without dropping
support for old RuboCop versions.
@sambostock sambostock force-pushed the dependabot/bundler/rubocop-1.57.1 branch from ad6545d to 194baa9 Compare December 11, 2023 19:50
@sambostock sambostock merged commit 77a050e into main Dec 11, 2023
20 checks passed
@sambostock sambostock deleted the dependabot/bundler/rubocop-1.57.1 branch December 11, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants