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

False autocorrect for Style/RedundantRegexpArgument with unicode character #11989

Closed
Earlopain opened this issue Jun 27, 2023 · 0 comments · Fixed by #11990
Closed

False autocorrect for Style/RedundantRegexpArgument with unicode character #11989

Earlopain opened this issue Jun 27, 2023 · 0 comments · Fixed by #11990
Labels

Comments

@Earlopain
Copy link
Contributor

This code

"a b".gsub(/\u3000/, "X")
# => "aXb"

suggests changing to this which changes semantics. The used whitespace here is the "Ideographic Space".

"a b".gsub("u3000", "X")
# => "a b"

RuboCop version

$ [bundle exec] rubocop -V
1.53.1 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [x86_64-linux-musl]
  - rubocop-erb 0.2.4
  - rubocop-rails 2.20.2
@koic koic added the bug label Jun 28, 2023
koic added a commit to koic/rubocop that referenced this issue Jun 28, 2023
…RegexpArgument`

Fixes rubocop#11989.

This PR fixes an incorrect autocorrect for `Style/RedundantRegexpArgument`
when using unicode chars.

This is a resolution applying the feedback below:
rubocop#11595 (comment)
@Earlopain Earlopain changed the title False positive for Style/RedundantRegexpArgument with unicode character False autocorrect for Style/RedundantRegexpArgument with unicode character Jun 28, 2023
bbatsov pushed a commit that referenced this issue Jun 28, 2023
…rgument`

Fixes #11989.

This PR fixes an incorrect autocorrect for `Style/RedundantRegexpArgument`
when using unicode chars.

This is a resolution applying the feedback below:
#11595 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants