Skip to content

Fix rubocop redundant freeze warnings#5468

Merged
jeffwidman merged 1 commit intodependabot:mainfrom
jeffwidman:fix-rubocop-freeze-warnings
Oct 25, 2022
Merged

Fix rubocop redundant freeze warnings#5468
jeffwidman merged 1 commit intodependabot:mainfrom
jeffwidman:fix-rubocop-freeze-warnings

Conversation

@jeffwidman
Copy link
Copy Markdown
Member

@jeffwidman jeffwidman commented Aug 3, 2022

Fix Rubocop freeze warnings.

Rubocop is warning about things that are double frozen, ie .freeze is redundant.

These warnings started showing up as part of the Ruby 3.1 upgrade, and
were excluded from that PR in order to minimize noise.

@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch from 53bb76d to 3970bc8 Compare August 3, 2022 07:49
@jeffwidman jeffwidman mentioned this pull request Aug 3, 2022

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0'.

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0'.
@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch 2 times, most recently from 7a97e8f to 655de48 Compare August 7, 2022 22:29
@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch 2 times, most recently from 96eccbf to a534e2a Compare September 13, 2022 01:18
@jeffwidman
Copy link
Copy Markdown
Member Author

I had to do a painful rebase on this one, and easily could have made a mistake. So once #5447 is merged and this is rebased on top of that, do a careful inspection of the changes to ensure I didn't screw it up.

Check warning

Code scanning / CodeQL

Overly permissive regular expression range

Suspicious character range that is equivalent to \[)*+,\-.\/0-9\].
@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch from a534e2a to 50bd13a Compare October 11, 2022 04:29
Copy link
Copy Markdown
Member Author

@jeffwidman jeffwidman Oct 11, 2022

Choose a reason for hiding this comment

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

Discovered this while looking at a related git blame... This could be pulled into a separate PR, but since just this small comment I thought okay to shoehorn into this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about we create a new draft PR that makes the change suggested by the TODO, and then we can pull that in when we're ready for it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good idea, I'll open a draft PR shortly... I'd also like to leave in the code comment so that we don't lose track of it...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch 3 times, most recently from 46efc29 to a77350a Compare October 11, 2022 05:08
@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch 2 times, most recently from 9a0f9ee to feaacf9 Compare October 24, 2022 22:57
@jeffwidman jeffwidman changed the title Fix rubocop freeze warnings Fix rubocop redundant freeze warnings Oct 24, 2022
@jeffwidman jeffwidman marked this pull request as ready for review October 24, 2022 22:59
@jeffwidman jeffwidman requested a review from a team as a code owner October 24, 2022 22:59
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this included by accident?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch from feaacf9 to c7af02c Compare October 24, 2022 23:06
@jeffwidman
Copy link
Copy Markdown
Member Author

jeffwidman commented Oct 24, 2022

Merging once passes CI as this lint rule is super safe fix

@jeffwidman jeffwidman enabled auto-merge October 24, 2022 23:18
@jeffwidman jeffwidman disabled auto-merge October 24, 2022 23:24
@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch from ca558b9 to c6691c7 Compare October 24, 2022 23:39
Rubocop is warning about things that are double frozen, ie `.freeze` is
redundant.

These warnings started showing up as part of the Ruby 3.1 upgrade, and
were excluded from that PR in order to minimize noise.

So this fixes them.

Co-authored-by: Mattt <mattt@github.com>
@jeffwidman jeffwidman force-pushed the fix-rubocop-freeze-warnings branch from c6691c7 to fd64bac Compare October 24, 2022 23:39
@jeffwidman jeffwidman enabled auto-merge October 24, 2022 23:44
@jeffwidman jeffwidman merged commit 77d2c67 into dependabot:main Oct 25, 2022
@jeffwidman jeffwidman deleted the fix-rubocop-freeze-warnings branch October 25, 2022 00:10
@pavera pavera mentioned this pull request Oct 31, 2022
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.

3 participants