Skip to content

Commit

Permalink
Fixes Rails/UnknownEnv offense
Browse files Browse the repository at this point in the history
- Cop: Rails/UnknownEnv
- Cf. https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsunknownenv
- Rails.env.typo? will always return false and will not return an error
- The way to check this is to add environments in the Environments config parameter
- in the rubocop file.
  • Loading branch information
cyrillefr committed Jun 25, 2024
1 parent 93798ed commit b09f411
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .rubocop_styleguide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ Rails/SkipsModelValidations:
- update_column
- update_columns

Rails/UnknownEnv:
Environments:
- development
- production
- staging
- test

Rails/WhereExists:
EnforcedStyle: where # Cf. conversion https://github.com/openfoodfoundation/openfoodnetwork/pull/12363

Expand Down
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,6 @@ Rails/UniqueValidationWithoutIndex:
- 'app/models/spree/tax_category.rb'
- 'app/models/spree/zone.rb'

# Offense count: 1
# Configuration parameters: Severity, Environments.
# Environments: development, test, production
Rails/UnknownEnv:
Exclude:
- 'app/models/spree/app_configuration.rb'

# Offense count: 1
Security/Open:
Exclude:
Expand Down

0 comments on commit b09f411

Please sign in to comment.