You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No issue while using ENVs and (not) equal operators
ifENV['DISABLE_DOTENV'] != '1'# Some Ruby codeend
Actual behavior
Style/FetchEnvVar: Use ENV.fetch('DISABLE_DOTENV') or ENV.fetch('DISABLE_DOTENV', nil) instead of ENV['DISABLE_DOTENV'].
if ENV['DISABLE_DOTENV'] != '1'
^^^^^^^^^^^^^^^^^^^^^
Fixesrubocop#10581.
This PR fixes a false positive for `Style/FetchEnvVar` when comparing with `ENV['TERM']`.
`ENV['DISABLE_DOTENV'] != '1'` could be treated the same as the already allowed in `used_as_flag?`
(that is, used as a flag).
Expected behavior
No issue while using ENVs and (not) equal operators
Actual behavior
Steps to reproduce the problem
Code snippet
Run
RuboCop version
The text was updated successfully, but these errors were encountered: