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

build(deps): bump rubocop from 1.48.1 to 1.49.0 in /Library/Homebrew #15136

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 3, 2023

Bumps rubocop from 1.48.1 to 1.49.0.

Release notes

Sourced from rubocop's releases.

RuboCop 1.49

New features

  • #11122: Add new Style/RedundantLineContinuation cop. (@​ydah)
  • #11696: Add new Style/DataInheritance cop. (@​ktopolski)
  • #11746: Make Layout/EndAlignment aware of pattern matching. (@​koic)
  • #11750: Make Metrics/BlockNesting aware of numbered parameter. (@​koic)
  • #11699: Make Style/ClassEqualityComparison aware of Class#to_s and Class#inspect for class equality comparison. (@​koic)
  • #11737: Make Style/MapToHash and Style/MapToSet aware of numbered parameters. (@​koic)
  • #11732: Make Style/MapToHash and Style/MapToSet aware of symbol proc. (@​koic)
  • #11703: Make Naming/InclusiveLanguage support autocorrection when there is only one suggestion. (@​koic)

Bug fixes

  • #11730: Fix an error for Layout/HashAlignment when using anonymous keyword rest arguments. (@​koic)
  • #11704: Fix a false positive for Lint/UselessMethodDefinition when method definition with non access modifier containing only super call. (@​koic)
  • #11723: Fix a false positive for Style/IfUnlessModifier when using one-line pattern matching as a if condition. (@​koic)
  • #11725: Fix an error when insufficient permissions to server cache dir are granted. (@​koic)
  • #11715: Ensure default configuration loads. (@​koic)
  • #11742: Fix error handling in bundler standalone mode. (@​composerinteralia)
  • #11712: Fix a crash in Lint/EmptyConditionalBody. (@​gsamokovarov)
  • #11641: Fix a false negative for Layout/ExtraSpacing when there are many comments with extra spaces. (@​nobuyo)
  • #11740: Fix a false positive for Lint/NestedMethodDefinition when nested definition inside *_eval and *_exec method call with a numblock. (@​ydah)
  • #11685: Fix incorrect directive comment insertion when percent array violates Layout/LineLength cop. (@​nobuyo)
  • #11706: Fix infinite loop when --disable-uncorrectable option and there is a multi-line percent array violates Layout/LineLength. (@​nobuyo)
  • #11697: Fix Lint/Syntax behavior when --only is not given the cop name. (@​koic)
  • #11709: Fix value omission false positive in Style/MethodCallWithArgsParentheses. (@​gsamokovarov)

Changes

  • #11739: Make Style/RedundantParentheses aware of redundant method argument parentheses. (@​koic)
  • #10766: Use the path given by --cache-root to be the parent for rubocop_cache dir like other ways to specify it. (@​nobuyo)
Changelog

Sourced from rubocop's changelog.

1.49.0 (2023-04-03)

New features

  • #11122: Add new Style/RedundantLineContinuation cop. ([@​ydah][])
  • #11696: Add new Style/DataInheritance cop. ([@​ktopolski][])
  • #11746: Make Layout/EndAlignment aware of pattern matching. ([@​koic][])
  • #11750: Make Metrics/BlockNesting aware of numbered parameter. ([@​koic][])
  • #11699: Make Style/ClassEqualityComparison aware of Class#to_s and Class#inspect for class equality comparison. ([@​koic][])
  • #11737: Make Style/MapToHash and Style/MapToSet aware of numbered parameters. ([@​koic][])
  • #11732: Make Style/MapToHash and Style/MapToSet aware of symbol proc. ([@​koic][])
  • #11703: Make Naming/InclusiveLanguage support autocorrection when there is only one suggestion. ([@​koic][])

Bug fixes

  • #11730: Fix an error for Layout/HashAlignment when using anonymous keyword rest arguments. ([@​koic][])
  • #11704: Fix a false positive for Lint/UselessMethodDefinition when method definition with non access modifier containing only super call. ([@​koic][])
  • #11723: Fix a false positive for Style/IfUnlessModifier when using one-line pattern matching as a if condition. ([@​koic][])
  • #11725: Fix an error when insufficient permissions to server cache dir are granted. ([@​koic][])
  • #11715: Ensure default configuration loads. ([@​koic][])
  • #11742: Fix error handling in bundler standalone mode. ([@​composerinteralia][])
  • #11712: Fix a crash in Lint/EmptyConditionalBody. ([@​gsamokovarov][])
  • #11641: Fix a false negative for Layout/ExtraSpacing when there are many comments with extra spaces. ([@​nobuyo][])
  • #11740: Fix a false positive for Lint/NestedMethodDefinition when nested definition inside *_eval and *_exec method call with a numblock. ([@​ydah][])
  • #11685: Fix incorrect directive comment insertion when percent array violates Layout/LineLength cop. ([@​nobuyo][])
  • #11706: Fix infinite loop when --disable-uncorrectable option and there is a multi-line percent array violates Layout/LineLength. ([@​nobuyo][])
  • #11697: Fix Lint/Syntax behavior when --only is not given the cop name. ([@​koic][])
  • #11709: Fix value omission false positive in Style/MethodCallWithArgsParentheses. ([@​gsamokovarov][])

Changes

  • #11739: Make Style/RedundantParentheses aware of redundant method argument parentheses. ([@​koic][])
  • #10766: Use the path given by --cache-root to be the parent for rubocop_cache dir like other ways to specify it. ([@​nobuyo][])
Commits
  • e534bd1 Cut 1.49
  • e72b491 Update Changelog
  • bf33f2f Merge pull request #11728 from ktopolski/add_new_data_inheritance_cop
  • 8c53464 Merge pull request #11750 from koic/make_metrics_block_nesting_aware_of_numbe...
  • bc42301 [Fix #11696] Add new Style/DataInheritance cop
  • 97a6d52 Make Metrics/BlockNesting aware of numbered parameter
  • 6cb7343 Merge pull request #11748 from nobuyo/cache-root-behavior
  • a822fee [Fix #10766] Use the path given by --cache-root to be the parent for `ruboc...
  • a677975 [Fix #11122] Add new Style/RedundantLineContinuation cop
  • ff383c6 Make Layout/EndAlignment aware of pattern matching
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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 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)

@dependabot dependabot bot added dependencies Bumping Gemfile dependencies ruby Pull requests that update Ruby code labels Apr 3, 2023
@MikeMcQuaid
Copy link
Member

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot/bundler/Library/Homebrew/rubocop-1.49.0 branch from 964e3ad to cf81f45 Compare April 4, 2023 09:20
@apainintheneck
Copy link
Contributor

There seem to be two new cops that are causing linter errors in taps, Style/MapToSet and Style/RedundantLineContinuation. Those should be relatively simple to fix.

The weird thing is that our custom cop tests are failing. Essentially, it now feels compelled to add the cop class name before the error message. I'm not sure we really want this behavior to be honest though it's not the end of the world if we have to settle for it.

         -  ^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'.
         +  ^^^^^^^^^^^^^^^^^^ FormulaAudit/MpiCheck: Formulae in homebrew/core should use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'.

This causes like 100 failures locally. Interestingly enough I didn't see this change apply to the internal Rubocop tests when taking a glance at the diff.

MikeMcQuaid added a commit to Homebrew/homebrew-core that referenced this pull request Apr 6, 2023
MikeMcQuaid added a commit to Homebrew/homebrew-core that referenced this pull request Apr 6, 2023
MikeMcQuaid added a commit to Homebrew/homebrew-core that referenced this pull request Apr 6, 2023
MikeMcQuaid added a commit to Homebrew/homebrew-core that referenced this pull request Apr 6, 2023
MikeMcQuaid added a commit to Homebrew/homebrew-core that referenced this pull request Apr 6, 2023
@MikeMcQuaid
Copy link
Member

Essentially, it now feels compelled to add the cop class name before the error message.

Feels like it's doing the equivalent of running --display-cop-names by default where it was --no-display-cop-names before. Perhaps the RuboCop test environment needs adjusted/tweaked accordingly?

MikeMcQuaid added a commit to Homebrew/homebrew-bundle that referenced this pull request Apr 7, 2023
@MikeMcQuaid
Copy link
Member

MikeMcQuaid commented Apr 7, 2023

@apainintheneck This seems to fix each individual spec but is obviously pretty ugly:

--- a/Library/Homebrew/test/rubocops/caveats_spec.rb
+++ b/Library/Homebrew/test/rubocops/caveats_spec.rb
@@ -4,7 +4,7 @@
 require "rubocops/caveats"
 
 describe RuboCop::Cop::FormulaAudit::Caveats do
-  subject(:cop) { described_class.new }
+  subject(:cop) { described_class.new(nil, {display_cop_names: false})}

We disable these by default here:

DisplayCopNames: false

but my guess is this version changes something about how configuration is picked up that means it doesn't respect that any more.

I have a very mild preference to keep that setting as-is but, given @dduugg has also provided feedback about not liking this default brew style behaviour, I'm tempted to say we drop this setting, fix all the tests accordingly and remove --display-cop-names.

What do you think?

@issyl0
Copy link
Member

issyl0 commented Apr 7, 2023

FWIW I tend to always add --display-cop-names to my brew style runs. I much prefer knowing the name of the rule that's failing so I can look it up/target it to fix. Swapping the default here would be excellent.

@MikeMcQuaid
Copy link
Member

@issyl0 Good enough for me! Would you be able to pick up fixing up these tests in this PR and removing --display-cop-names from brew style and .rubocop.yml to make it default behaviour? Thanks!

@issyl0 issyl0 self-assigned this Apr 7, 2023
issyl0 added a commit that referenced this pull request Apr 7, 2023
- Fixing the test expected output was unbelievably tedious.
- There's been debate about this setting being `false` but in
  #15136 (comment)
  we decided that it was worth using the default since RuboCop behaviour changed
  so we'd have had to do some horrible things to keep it as `false` -
  #15136 (comment) -
  and multiple maintainers specify the `--display-cop-names` option to
  `brew style` themselves since it's clearer what's gone wrong.
issyl0 added a commit to Homebrew/homebrew-aliases that referenced this pull request Apr 7, 2023
dependabot bot and others added 5 commits April 7, 2023 19:10
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.48.1 to 1.49.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.48.1...v1.49.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
- Fixing the test expected output was unbelievably tedious.
- There's been debate about this setting being `false` but in
  #15136 (comment)
  we decided that it was worth using the default since RuboCop behaviour changed
  so we'd have had to do some horrible things to keep it as `false` -
  #15136 (comment) -
  and multiple maintainers specify the `--display-cop-names` option to
  `brew style` themselves since it's clearer what's gone wrong.
@issyl0 issyl0 force-pushed the dependabot/bundler/Library/Homebrew/rubocop-1.49.0 branch from 312a8e1 to da734a3 Compare April 7, 2023 18:14
- This was determinig `blank?` on a `Pathname` object, which returned
  `true` always, making the test fail. Instead, check the string value.
@MikeMcQuaid MikeMcQuaid merged commit 291a7e0 into master Apr 7, 2023
24 checks passed
@MikeMcQuaid MikeMcQuaid deleted the dependabot/bundler/Library/Homebrew/rubocop-1.49.0 branch April 7, 2023 19:09
@apainintheneck
Copy link
Contributor

Makes sense to me. Thanks!

@MikeMcQuaid
Copy link
Member

Thanks for getting this over the line @issyl0! 🎉

@github-actions github-actions bot added the outdated PR was locked due to age label May 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Bumping Gemfile dependencies outdated PR was locked due to age ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants