We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Lint/MixedCaseRange
As shown below, a regex wouldn't normally be written this way, but it can occur when using an LSP.
Shouldn't raise.
undefined method `begin' for nil /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/lint/mixed_case_range.rb:105:in `rewrite_regexp_range' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/lint/mixed_case_range.rb:51:in `block (2 levels) in on_regexp' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/base.rb:392:in `correct' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/base.rb:181:in `add_offense' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/lint/mixed_case_range.rb:50:in `block in on_regexp' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/lint/mixed_case_range.rb:65:in `block (2 levels) in each_unsafe_regexp_range' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/lint/mixed_case_range.rb:60:in `reject' /Users/andyw8/.gem/ruby/3.3.0/gems/rubocop-1.62.1/lib/rubocop/cop/lint/mixed_case_range.rb:60:in `block in each_unsafe_regexp_range' /Users/andyw8/.gem/ruby/3.3.0/gems/regexp_parser-2.9.0/lib/regexp_parser/expression/methods/traverse.rb:75:in `block in each_expression_without_index'
Run against this:
/[A-_]$/
1.62.1 (using Parser 3.3.0.5, rubocop-ast 1.31.2, running on ruby 3.3.0) [arm64-darwin23] - rubocop-minitest 0.35.0 - rubocop-rake 0.6.0 - rubocop-sorbet 0.8.0
The text was updated successfully, but these errors were encountered:
[Fix rubocop#12843] Fix an error for Lint/MixedCaseRange
1827546
Fixes rubocop#12843. This PR fixes an error for `Lint/MixedCaseRange` When a character between `Z` and `a` is used in the regexp range.
015e249
Fixes rubocop#12843. This PR fixes an error for `Lint/MixedCaseRange` when a character between `Z` and `a` is used in the regexp range.
[Fix #12843] Fix an error for Lint/MixedCaseRange
2d39a72
Fixes #12843. This PR fixes an error for `Lint/MixedCaseRange` when a character between `Z` and `a` is used in the regexp range.
Successfully merging a pull request may close this issue.
As shown below, a regex wouldn't normally be written this way, but it can occur when using an LSP.
Expected behavior
Shouldn't raise.
Actual behavior
Steps to reproduce the problem
Run against this:
RuboCop version
The text was updated successfully, but these errors were encountered: