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.58.0 to 1.59.0 #11933

Merged
merged 4 commits into from
Dec 14, 2023
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 12, 2023

Bumps rubocop from 1.58.0 to 1.59.0.

Release notes

Sourced from rubocop's releases.

RuboCop 1.59

New features

Bug fixes

  • #12434: Fix a false positive for Lint/LiteralAssignmentInCondition when using interpolated string or xstring literals. (@​koic)
  • #12435: Fix a false positive for Lint/SelfAssignment when using attribute assignment with method call with arguments. (@​koic)
  • #12444: Fix false positive for Style/HashEachMethods when receiver literal is not a hash literal. (@​koic)
  • #12524: Fix a false positive for Style/MethodCallWithArgsParentheses when EnforcedStyle: omit_parentheses and parens in when clause is used to pass an argument. (@​koic)
  • #12505: Fix a false positive for Style/RedundantParentheses when using parenthesized lambda or proc with do...end block. (@​koic)
  • #12442: Fix an incorrect autocorrect for Style/CombinableLoops when looping over the same data as previous loop in do...end and {...} blocks. (@​koic)
  • #12432: Fix a false positive for Lint/LiteralAssignmentInCondition when using parallel assignment with splat operator in block of guard condition. (@​koic)
  • #12441: Fix false positives for Style/HashEachMethods when using destructed block arguments. (@​koic)
  • #12436: Fix false positives for Style/RedundantParentheses when a part of range is a parenthesized condition. (@​koic)
  • #12429: Fix incorrect autocorrect for Style/MapToHash when using dot method calls for to_h. (@​koic)
  • #12488: Make Lint/HashCompareByIdentity aware of safe navigation operator. (@​koic)
  • #12489: Make Lint/NextWithoutAccumulator aware of safe navigation operator. (@​koic)
  • #12490: Make Lint/NumberConversion aware of safe navigation operator. (@​koic)
  • #12491: Make Lint/RedundantWithIndex aware of safe navigation operator. (@​koic)
  • #12492: Make Lint/RedundantWithObject aware of safe navigation operator. (@​koic)
  • #12493: Make Lint/UnmodifiedReduceAccumulator aware of safe navigation operator. (@​koic)
  • #12473: Make Style/ClassCheck aware of safe navigation operator. (@​koic)
  • #12445: Make Style/CollectionCompact aware of safe navigation operator. (@​koic)
  • #12474: Make Style/ConcatArrayLiterals aware of safe navigation operator. (@​koic)
  • #12476: Make Style/DateTime aware of safe navigation operator. (@​koic)
  • #12479: Make Style/EachWithObject aware of safe navigation operator. (@​koic)
  • #12446: Make Style/HashExcept aware of safe navigation operator. (@​koic)
  • #12447: Make Style/MapCompactWithConditionalBlock aware of safe navigation operator. (@​koic)
  • #12484: Make Style/Next aware of safe navigation operator. (@​koic)
  • #12486: Make Style/RedundantArgument aware of safe navigation operator. (@​koic)
  • #12454: Make Style/RedundantFetchBlock aware of safe navigation operator. (@​koic)
  • #12495: Make Layout/RedundantLineBreak aware of safe navigation operator. (@​koic)
  • #12455: Make Style/RedundantSortBy aware of safe navigation operator. (@​koic)
  • #12456: Make Style/RedundantSortBy aware of safe navigation operator. (@​koic)
  • #12480: Make Style/ExactRegexpMatch aware of safe navigation operator. (@​koic)
  • #12457: Make Style/Sample aware of safe navigation operator. (@​koic)
  • #12458: Make Style/SelectByRegexp cops aware of safe navigation operator. (@​koic)
  • #12494: Make Layout/SingleLineBlockChain aware of safe navigation operator. (@​koic)
  • #12461: Make Style/StringChars aware of safe navigation operator. (@​koic)
  • #12468: Make Style/Strip aware of safe navigation operator. (@​koic)
  • #12469: Make Style/UnpackFirst aware of safe navigation operator. (@​koic)

Changes

  • #12522: Make Style/MethodCallWithoutArgsParentheses allow the parenthesized it method in a block. (@​koic)
  • #12523: Make Style/RedundantSelf allow the self.it method in a block. (@​koic)
Changelog

Sourced from rubocop's changelog.

1.59.0 (2023-12-11)

New features

Bug fixes

  • #12434: Fix a false positive for Lint/LiteralAssignmentInCondition when using interpolated string or xstring literals. ([@​koic][])
  • #12435: Fix a false positive for Lint/SelfAssignment when using attribute assignment with method call with arguments. ([@​koic][])
  • #12444: Fix false positive for Style/HashEachMethods when receiver literal is not a hash literal. ([@​koic][])
  • #12524: Fix a false positive for Style/MethodCallWithArgsParentheses when EnforcedStyle: omit_parentheses and parens in when clause is used to pass an argument. ([@​koic][])
  • #12505: Fix a false positive for Style/RedundantParentheses when using parenthesized lambda or proc with do...end block. ([@​koic][])
  • #12442: Fix an incorrect autocorrect for Style/CombinableLoops when looping over the same data as previous loop in do...end and {...} blocks. ([@​koic][])
  • #12432: Fix a false positive for Lint/LiteralAssignmentInCondition when using parallel assignment with splat operator in block of guard condition. ([@​koic][])
  • #12441: Fix false positives for Style/HashEachMethods when using destructed block arguments. ([@​koic][])
  • #12436: Fix false positives for Style/RedundantParentheses when a part of range is a parenthesized condition. ([@​koic][])
  • #12429: Fix incorrect autocorrect for Style/MapToHash when using dot method calls for to_h. ([@​koic][])
  • #12488: Make Lint/HashCompareByIdentity aware of safe navigation operator. ([@​koic][])
  • #12489: Make Lint/NextWithoutAccumulator aware of safe navigation operator. ([@​koic][])
  • #12490: Make Lint/NumberConversion aware of safe navigation operator. ([@​koic][])
  • #12491: Make Lint/RedundantWithIndex aware of safe navigation operator. ([@​koic][])
  • #12492: Make Lint/RedundantWithObject aware of safe navigation operator. ([@​koic][])
  • #12493: Make Lint/UnmodifiedReduceAccumulator aware of safe navigation operator. ([@​koic][])
  • #12473: Make Style/ClassCheck aware of safe navigation operator. ([@​koic][])
  • #12445: Make Style/CollectionCompact aware of safe navigation operator. ([@​koic][])
  • #12474: Make Style/ConcatArrayLiterals aware of safe navigation operator. ([@​koic][])
  • #12476: Make Style/DateTime aware of safe navigation operator. ([@​koic][])
  • #12479: Make Style/EachWithObject aware of safe navigation operator. ([@​koic][])
  • #12446: Make Style/HashExcept aware of safe navigation operator. ([@​koic][])
  • #12447: Make Style/MapCompactWithConditionalBlock aware of safe navigation operator. ([@​koic][])
  • #12484: Make Style/Next aware of safe navigation operator. ([@​koic][])
  • #12486: Make Style/RedundantArgument aware of safe navigation operator. ([@​koic][])
  • #12454: Make Style/RedundantFetchBlock aware of safe navigation operator. ([@​koic][])
  • #12495: Make Layout/RedundantLineBreak aware of safe navigation operator. ([@​koic][])
  • #12455: Make Style/RedundantSortBy aware of safe navigation operator. ([@​koic][])
  • #12456: Make Style/RedundantSortBy aware of safe navigation operator. ([@​koic][])
  • #12480: Make Style/ExactRegexpMatch aware of safe navigation operator. ([@​koic][])
  • #12457: Make Style/Sample aware of safe navigation operator. ([@​koic][])
  • #12458: Make Style/SelectByRegexp cops aware of safe navigation operator. ([@​koic][])
  • #12494: Make Layout/SingleLineBlockChain aware of safe navigation operator. ([@​koic][])
  • #12461: Make Style/StringChars aware of safe navigation operator. ([@​koic][])
  • #12468: Make Style/Strip aware of safe navigation operator. ([@​koic][])
  • #12469: Make Style/UnpackFirst aware of safe navigation operator. ([@​koic][])

Changes

  • #12522: Make Style/MethodCallWithoutArgsParentheses allow the parenthesized it method in a block. ([@​koic][])
  • #12523: Make Style/RedundantSelf allow the self.it method in a block. ([@​koic][])
Commits
  • e5a164a Cut 1.59
  • 2912b6e Update Changelog
  • 3bcc171 [Fix #12524] Fix a false positive for Style/MethodCallWithArgsParentheses
  • 0daa4aa Make Style/MethodCallWithoutArgsParentheses allow parenthesized it
  • b240a09 Make Style/RedundantSelf allow self.it
  • a0e1042 [Fix #12526] Fix incorrect rendering typos
  • b1bcb31 [Fix #12444] Fix false positive for Style/HashEachMethods
  • 3b0360b Add new Lint/ItWithoutArgumentsInBlock cop
  • 4e9cfcc Merge pull request #12521 from koic/make_style_select_by_regexp_aware_of_safe...
  • 037c860 Merge pull request #12438 from koic/fix_a_false_positive_for_lint_literal_ass...
  • 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 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)

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.58.0 to 1.59.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.58.0...v1.59.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies ruby Pull requests that update Ruby code labels Dec 12, 2023
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

1519 files inspected, 45 offenses detected, 28 offenses autocorrectable

I'll regenerate the todo file.

@mkllnk
Copy link
Member

mkllnk commented Dec 13, 2023

After regenerating the todo file, Rails/OutputSafety is still coming up.

1519 files inspected, 16 offenses detected

They seem to be false positives though:

lib/reporting/queries/query_builder.rb:71:57: C: Rails/OutputSafety: Tagging a string as html safe may be a security risk.
        combined_description = sql_concat(display_name, raw("' ('"), unit_to_display, raw("')'"))
                                                        ^^^

It thinks that raw is the Rails helper for raw HTML output but it's raw SQL here, intentionally. We may need to open an issue for this. Until then, I'll close this as faulty release. Oh, hang on, this problem is on master already! And it's connected to a Rails cop.

I did a git bisect to find the culprit and found it:

@dacook Your rule is great but it overrides the todo file. Cop settings are stored in a hash and each key can be present once only. So Exclude can be defined only once. Not sure how to solve that though.

@dacook
Copy link
Member

dacook commented Dec 13, 2023

Oh, how unfortunate. Maybe we could move my rule to the todo file? Hmm no, then when we regenerate it, it will replace the rule.

Maybe we should fix all the Rails/OutputSafety todos? They're probably all valid uses, and just need a rubocop:disable comment. I can try after lunch if you like.

The tag generator methods should already be returning html_safe strings.
These all seem to require html_safe/raw, so we'll permit it.
Some of the spree code is a bit strange and could probably be improved, but I think it's ok for now.
This one is a little more concerning: what if a model error message includes the user-submitted value? But this is for the admin interface only, and I'm not sure if we have model error messages that do that. So it's probably fine (it's certainly been like this a long time already).
@dacook dacook requested a review from mkllnk December 13, 2023 05:31
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Great work.

I keep wondering if some of these could have been written in a better way. But we don't need to add to our list at the moment.

And in the end, this now means that you are not allowed to add any violations of this cop to the todo list. You have to solve it or add a comment in the code. I'm happy with that.

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Nice to see some clean up of the todo list 🧹

@rioug rioug merged commit b8e2491 into master Dec 14, 2023
52 checks passed
@rioug rioug deleted the dependabot/bundler/rubocop-1.59.0 branch December 14, 2023 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies ruby Pull requests that update Ruby code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants