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

StandardActions config parsing broken when missing #7

Open
josler opened this issue May 18, 2022 · 1 comment
Open

StandardActions config parsing broken when missing #7

josler opened this issue May 18, 2022 · 1 comment

Comments

@josler
Copy link

josler commented May 18, 2022

Here I upgraded from 1.0 to 1.1 and things broke with this error - we probably want to use fetch and default that one :)

An error occurred while Betterment/NonStandardActions cop was inspecting /Users/jamie/src/equals/test/controllers/application_controller_test.rb:123:4.
undefined method `+' for nil:NilClass

          @allowed_actions ||= cop_config['StandardActions'] + cop_config['AdditionalAllowedActions'] # rubocop:disable InternalAffairs/UndefinedConfig
                                                             ^
/Users/jamie/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/betterlint-1.1.0/lib/rubocop/cop/betterment/non_standard_actions.rb:65:in `allowed_actions'
/Users/jamie/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/betterlint-1.1.0/lib/rubocop/cop/betterment/non_standard_actions.rb:69:in `allowed_action?'
/Users/jamie/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/betterlint-1.1.0/lib/rubocop/cop/betterment/non_standard_actions.rb:58:in `check_raw_route'
/Users/jamie/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/betterlint-1.1.0/lib/rubocop/cop/betterment/non_standard_actions.rb:34:in `block in on_block'
@smudge
Copy link
Member

smudge commented Jun 15, 2022

Hi @josler -- I'm trying to reproduce this issue! That config value should have a default list provided by the YML config, so I'm wondering if maybe you're doing something other than using inherit_gem to load that default config:

inherit_gem:
  betterlint:
    - config/default.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants