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

An error occurred while Style/StringConcatenation cop was inspecting a file #10403

Closed
vhiairrassary opened this issue Feb 8, 2022 · 0 comments · Fixed by #10404
Closed

An error occurred while Style/StringConcatenation cop was inspecting a file #10403

vhiairrassary opened this issue Feb 8, 2022 · 0 comments · Fixed by #10404
Labels

Comments

@vhiairrassary
Copy link

vhiairrassary commented Feb 8, 2022

The following file displays a An error occurred while Style/StringConcatenation cop was inspecting message when processed by rubocop:

csv = "\xEF\xBB\xBF" + <<-SQL
  "A","B"
  "1","2"
SQL

Expected behavior

Rubocop should not display this error message, as the code works as expected in Ruby REPL.

Actual behavior

Here is the output from bundle exec rubocop --debug ./example.rb:

For /Users/vhiairrassary/test-repo: configuration from /Users/vhiairrassary/test-repo/.rubocop.yml
Default configuration from /Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/config/default.yml
Use parallel by default.
Running parallel inspection
An error occurred while Style/StringConcatenation cop was inspecting /Users/vhiairrassary/test-repo/example.rb:1:6.
undefined method `begin' for #<Parser::Source::Map::Heredoc:0x00007fe2aef862c0 @heredoc_body=#<Parser::Source::Range /Users/vhiairrassary/test-repo/example.rb 30...50>, @heredoc_end=#<Parser::Source::Range /Users/vhiairrassary/test-repo/example.rb 50...53>, @expression=#<Parser::Source::Range /Users/vhiairrassary/test-repo/example.rb 23...29>, @node=s(:dstr,
  s(:str, "  \"A\",\"B\"\n"),
  s(:str, "  \"1\",\"2\"\n"))>
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/mixin/range_help.rb:33:in `contents_range'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:152:in `block in replacement'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:146:in `map'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:146:in `replacement'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:90:in `block in register_offense'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/base.rb:342:in `correct'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/base.rb:127:in `add_offense'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:87:in `register_offense'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:81:in `on_send'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:136:in `public_send'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:136:in `block (2 levels) in trigger_restricted_cops'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:135:in `block in trigger_restricted_cops'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:134:in `each'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:134:in `trigger_restricted_cops'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:70:in `on_send'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.15.1/lib/rubocop/ast/traversal.rb:134:in `on_lvasgn'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:71:in `on_lvasgn'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.15.1/lib/rubocop/ast/traversal.rb:20:in `walk'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:86:in `investigate'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/team.rb:155:in `investigate_partial'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/team.rb:83:in `investigate'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:309:in `inspect_file'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:253:in `block in do_inspection_loop'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:287:in `block in iterate_until_no_changes'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:280:in `loop'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:280:in `iterate_until_no_changes'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:249:in `do_inspection_loop'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:130:in `block in file_offenses'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:155:in `file_offense_cache'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:129:in `file_offenses'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:67:in `block in warm_cache'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:515:in `call_with_index'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:485:in `process_incoming_jobs'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:465:in `block in worker'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:456:in `fork'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:456:in `worker'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:447:in `block in create_workers'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `each'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `each_with_index'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `create_workers'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:386:in `work_in_processes'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:289:in `map'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/parallel-1.21.0/lib/parallel.rb:238:in `each'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:67:in `warm_cache'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:46:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command.rb:11:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/environment.rb:18:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli.rb:71:in `run_command'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli.rb:78:in `execute_runners'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli.rb:47:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/exe/rubocop:12:in `block in <top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/exe/rubocop:12:in `<top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/rubocop:25:in `load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/rubocop:25:in `<top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli/exec.rb:58:in `load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli/exec.rb:58:in `kernel_load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli/exec.rb:23:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli.rb:478:in `exec'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli.rb:31:in `dispatch'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli.rb:25:in `start'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:49:in `block in <top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:37:in `<top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/bundle:23:in `load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/bundle:23:in `<main>'
Inspecting 1 file
Scanning /Users/vhiairrassary/test-repo/example.rb
An error occurred while Style/StringConcatenation cop was inspecting /Users/vhiairrassary/test-repo/example.rb:1:6.
undefined method `begin' for #<Parser::Source::Map::Heredoc:0x00007fe26f85f9b8 @heredoc_body=#<Parser::Source::Range /Users/vhiairrassary/test-repo/example.rb 30...50>, @heredoc_end=#<Parser::Source::Range /Users/vhiairrassary/test-repo/example.rb 50...53>, @expression=#<Parser::Source::Range /Users/vhiairrassary/test-repo/example.rb 23...29>, @node=s(:dstr,
  s(:str, "  \"A\",\"B\"\n"),
  s(:str, "  \"1\",\"2\"\n"))>
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/mixin/range_help.rb:33:in `contents_range'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:152:in `block in replacement'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:146:in `map'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:146:in `replacement'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:90:in `block in register_offense'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/base.rb:342:in `correct'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/base.rb:127:in `add_offense'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:87:in `register_offense'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/style/string_concatenation.rb:81:in `on_send'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:136:in `public_send'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:136:in `block (2 levels) in trigger_restricted_cops'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:135:in `block in trigger_restricted_cops'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:134:in `each'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:134:in `trigger_restricted_cops'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:70:in `on_send'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.15.1/lib/rubocop/ast/traversal.rb:134:in `on_lvasgn'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:71:in `on_lvasgn'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.15.1/lib/rubocop/ast/traversal.rb:20:in `walk'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/commissioner.rb:86:in `investigate'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/team.rb:155:in `investigate_partial'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cop/team.rb:83:in `investigate'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:309:in `inspect_file'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:253:in `block in do_inspection_loop'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:287:in `block in iterate_until_no_changes'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:280:in `loop'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:280:in `iterate_until_no_changes'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:249:in `do_inspection_loop'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:130:in `block in file_offenses'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:155:in `file_offense_cache'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:129:in `file_offenses'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:120:in `process_file'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:101:in `block in each_inspected_file'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:100:in `each'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:100:in `reduce'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:100:in `each_inspected_file'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:86:in `inspect_files'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/runner.rb:47:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/command.rb:11:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli/environment.rb:18:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli.rb:71:in `run_command'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli.rb:78:in `execute_runners'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/lib/rubocop/cli.rb:47:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/exe/rubocop:12:in `block in <top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rubocop-1.25.1/exe/rubocop:12:in `<top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/rubocop:25:in `load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/rubocop:25:in `<top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli/exec.rb:58:in `load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli/exec.rb:58:in `kernel_load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli/exec.rb:23:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli.rb:478:in `exec'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli.rb:31:in `dispatch'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/cli.rb:25:in `start'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:49:in `block in <top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/3.0.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/Users/vhiairrassary/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:37:in `<top (required)>'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/bundle:23:in `load'
/Users/vhiairrassary/.rbenv/versions/3.0.3/bin/bundle:23:in `<main>'
W

Offenses:

example.rb:1:1: W: Lint/UselessAssignment: Useless assignment to variable - csv.
csv = "\xEF\xBB\xBF" + <<-SQL
^^^

1 file inspected, 1 offense detected

1 error occurred:
An error occurred while Style/StringConcatenation cop was inspecting /Users/vhiairrassary/test-repo/example.rb:1:6.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop/rubocop/issues

Mention the following information in the issue report:
1.25.1 (using Parser 3.1.0.0, rubocop-ast 1.15.1, running on ruby 3.0.3 x86_64-darwin21)
Finished in 0.3076839999994263 seconds

Steps to reproduce the problem

Simply run rubocop --debug ./example.rb on the file mentioned at the beginning of the issue.

RuboCop version

> bundle exec rubocop -V
1.25.1 (using Parser 3.1.0.0, rubocop-ast 1.15.1, running on ruby 3.0.3 x86_64-darwin21)
@koic koic added the bug label Feb 8, 2022
koic added a commit to koic/rubocop that referenced this issue Feb 8, 2022
Fixes rubocop#10403.

This PR fixes an error for `Style/StringConcatenation`
when string concatenation with multiline heredoc text.
bbatsov pushed a commit that referenced this issue Feb 9, 2022
Fixes #10403.

This PR fixes an error for `Style/StringConcatenation`
when string concatenation with multiline heredoc text.
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