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
…ation`
Fixesrubocop#12271.
This PR fixes a false positive for `Lint/RedundantSafeNavigation`
when using snake case constant receiver.
Camel case is used for naming classes and modules, while snake case is used for all other constants.
This naming conforms with `Naming/ConstantName` cop.
Since constants that turn into classes or modules are normally not `nil`, they will continue to be detected.
However, this PR will update to allow safe navigation for constants in snake case.
This change resolves both issue rubocop/rubocop-rails#1104 and rubocop#12271.
Fixes#12271.
This PR fixes a false positive for `Lint/RedundantSafeNavigation`
when using snake case constant receiver.
Camel case is used for naming classes and modules, while snake case is used for all other constants.
This naming conforms with `Naming/ConstantName` cop.
Since constants that turn into classes or modules are normally not `nil`, they will continue to be detected.
However, this PR will update to allow safe navigation for constants in snake case.
This change resolves both issue rubocop/rubocop-rails#1104 and #12271.
Expected behavior
Actual behavior
I don't believe we should flag constants as not needing safe navigation.
Steps to reproduce the problem
This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
RuboCop version
Potential Fix
Consider deleting this line?
rubocop/lib/rubocop/cop/lint/redundant_safe_navigation.rb
Line 76 in 128618c
The text was updated successfully, but these errors were encountered: