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
Error on multi-line regexp /.../x #7655
Labels
Comments
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Jan 24, 2020
Fixes rubocop#7655. This PR fixes the following error when processing a regexp with a line break at the start of capture parenthesis. ```console % cat examle.rb /( pattern )/ =~ string % bundle exec rubocop -d (snip) An error occurred while VariableForce cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/7655/examle.rb. end pattern with unmatched parenthesis: /( / /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `initialize' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `new' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `regexp_captured_names' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:174:in `process_regexp_named_captures' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:86:in `process_node' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:80:in `investigate' ```
bbatsov
pushed a commit
that referenced
this issue
Jan 25, 2020
Fixes #7655. This PR fixes the following error when processing a regexp with a line break at the start of capture parenthesis. ```console % cat examle.rb /( pattern )/ =~ string % bundle exec rubocop -d (snip) An error occurred while VariableForce cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/7655/examle.rb. end pattern with unmatched parenthesis: /( / /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `initialize' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `new' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `regexp_captured_names' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:174:in `process_regexp_named_captures' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:86:in `process_node' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:80:in `investigate' ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error occurs with code below:
Works:
Expected behavior
No errors.
Actual behavior
An error occurred while VariableForce cop
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: