Closed unused closed 11 months ago
I'm also seeing this but oddly only in github actions - when I run locally it doesn't happen.
I thought maybe it was because I was using 3.2 locally but actions was using 3.0 but I tried 3.2 in actions and that failed.
Here's a full back trace from one of our failures:
undefined method `assignment?' for nil:NilClass
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb:104:in `assertion_method?'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb:104:in `assertion_method?'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:68:in `assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `block in assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:28:in `block in each_child_node'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each_child_node'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `sum'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `block in assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:28:in `block in each_child_node'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each_child_node'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `sum'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `block in assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:28:in `block in each_child_node'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each_child_node'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `sum'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `assertions_count'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:40:in `block in on_class'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:39:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:39:in `on_class'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:107:in `public_send'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:107:in `block (2 levels) in trigger_responding_cops'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:171:in `with_cop_error_handling'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:106:in `block in trigger_responding_cops'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:105:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:105:in `trigger_responding_cops'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:69:in `on_class'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/traversal.rb:138:in `on_while'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:71:in `on_module'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/traversal.rb:137:in `block in on_dstr'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/traversal.rb:137:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/traversal.rb:137:in `on_dstr'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/commissioner.rb:87:in `investigate'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/team.rb:156:in `investigate_partial'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cop/team.rb:98:in `investigate'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:345:in `block in inspect_file'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:344:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:344:in `flat_map'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:344:in `inspect_file'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:287:in `block in do_inspection_loop'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:321:in `block in iterate_until_no_changes'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:314:in `loop'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:314:in `iterate_until_no_changes'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:283:in `do_inspection_loop'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:164:in `block in file_offenses'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:189:in `file_offense_cache'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:163:in `file_offenses'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:154:in `process_file'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:135:in `block in each_inspected_file'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:134:in `each'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:134:in `reduce'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:134:in `each_inspected_file'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:120:in `inspect_files'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/runner.rb:73:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli/command.rb:11:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli/environment.rb:18:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli.rb:118:in `run_command'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli.rb:125:in `execute_runners'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli.rb:51:in `block in run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli.rb:77:in `profile_if_needed'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/lib/rubocop/cli.rb:43:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/exe/rubocop:19:in `block in <top (required)>'
/opt/hostedtoolcache/Ruby/3.0.6/x64/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/rubocop-1.59.0/exe/rubocop:19:in `<top (required)>'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/bin/rubocop:25:in `load'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/bin/rubocop:25:in `<top (required)>'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:58:in `load'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:58:in `kernel_load'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:23:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/cli.rb:492:in `exec'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/cli.rb:34:in `dispatch'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/cli.rb:28:in `start'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/exe/bundle:37:in `block in <top (required)>'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/home/runner/work/openstreetmap-website/openstreetmap-website/vendor/bundle/ruby/3.0.0/gems/bundler-2.4.19/exe/bundle:29:in `<top (required)>'
/opt/hostedtoolcache/Ruby/3.0.6/x64/bin/bundle:25:in `load'
/opt/hostedtoolcache/Ruby/3.0.6/x64/bin/bundle:25:in `<main>'
similar line is erroring for me as well, put notes up at https://github.com/rubocop/rubocop-minitest/issues/284
Expected behavior
No Error when using a conditional assignment operator
||=
anywhere in the test-file.Actual behavior
With
NewCops: enable
rubocop-minitest raises an error when a conditional assignment is used.Steps to reproduce the problem
Given the following configuration, an error is raised.
RuboCop version