rubocop / rubocop-rails

A RuboCop extension focused on enforcing Rails best practices and coding conventions.
https://docs.rubocop.org/rubocop-rails
MIT License
821 stars 263 forks source link

Change `Rails/EnvLocal` to handle negated conditions #1374

Closed fatkodima closed 1 month ago

fatkodima commented 1 month ago

Currently, EnvLocal cop does not detect !Rails.env.development? && !Rails.env.test? as an offense (!Rails.env.local?).

I found a few such cases in my project.