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

Style/RedundantRegexpCharacterClass false positive #8593

Closed
marcandre opened this issue Aug 26, 2020 · 0 comments
Closed

Style/RedundantRegexpCharacterClass false positive #8593

marcandre opened this issue Aug 26, 2020 · 0 comments
Labels
bug good first issue Easy task, suitable for newcomers to the project help wanted

Comments

@marcandre
Copy link
Contributor

marcandre commented Aug 26, 2020

/#{Regexp.union(
  %w"( ) { } [ ] < > $ ! ^ ` ... + * ? ,"
)}/o

is incorrectly detected and corrected...

[Corrected] Style/RedundantRegexpCharacterClass: Redundant single-element character class, [ ] can be replaced with  .
  %w"( ) { } [ ] < > $ ! ^ ` ... + * ? ,"
             ^^^

This cop should use the Regexp parser and only check the literal sections.

@marcandre marcandre added bug good first issue Easy task, suitable for newcomers to the project help wanted labels Aug 26, 2020
@koic koic closed this as completed in 86c854a Aug 26, 2020
koic added a commit that referenced this issue Aug 26, 2020
…_regexps

[Fix #8593] Ignore multi-line interpolations in `Style/RedundantRegexpCharacterClass`
owst added a commit to owst/rubocop that referenced this issue Aug 31, 2020
bbatsov pushed a commit that referenced this issue Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Easy task, suitable for newcomers to the project help wanted
Projects
None yet
Development

No branches or pull requests

1 participant