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
Redundant usage of Boolean.not() #7019
Comments
Hi @osipxd I think you can use the |
Unfortunately not. When I add pattern |
I think, this rule might be generalized to "Redundant explicit usage of an operator" with configurable list of operators to be reported. RedundantExplicitOperatorCall:
enabled: true
operators:
- not
- plusAssign |
By the way, @atulgpt. I've noticed that you prefer to use I know the point that Some statisticsUsages of |
Hi @osipxd, I think it's my preference as I somehow find But I am not against forbidding the use of I completely agree with double Inverted rule as that pattern should be disallowed |
"Double negative expression" sounds like a great rule for detekt. And about this rule I don't think we should have a rule that forbids the usage of |
Closing this one in favor of the created issues. Let's continue discussion there. |
Obsolete. Superseded by:
Expected Behavior of the rule
Suggest to replace
Boolean.not()
by the operator!
if it is possible.Context
.not()
. Applying of such refactoring produces double-negative expression!isValid.not()
The text was updated successfully, but these errors were encountered: