-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
MultiRule should pass correctly the BindingContext #4071
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4071 +/- ##
=========================================
Coverage 83.58% 83.58%
- Complexity 3186 3187 +1
=========================================
Files 459 459
Lines 9099 9101 +2
Branches 1772 1772
=========================================
+ Hits 7605 7607 +2
Misses 561 561
Partials 933 933
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!!!
@@ -168,7 +168,7 @@ class UseIsNullOrEmpty(config: Config = Config.empty) : Rule(config) { | |||
|
|||
private val stringClass = StandardNames.FqNames.string.toSafe() | |||
|
|||
private val isEmptyFunctions = collectionClasses.map { FqName("$it.isEmpty") } + | |||
private val emptyCheckFunctions = collectionClasses.map { FqName("$it.isEmpty") } + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a renaming that's not relevant? Just checking if we are accidentally cherry-picking other commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's relevant actually. BooleanPropertyNaming
was not the only rule affected by this. The NonBooleanPropertyPrefixedWithIs
was affected as well and now got triggered on the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is now catching issues. Got it!
* MultiRule should pass correctly the BindingContext * Fix violation of NonBooleanPropertyPrefixedWithIs
Fixes #4058
The rule
BooleanPropertyNaming
that was recently added relies on Type Resolution. That rule was plugged inside aMultiRule
instead of a classicalRuleSetProvider
.Given that rules rely on inheritance to access a
BindingContext
, theMultiRule
should pass over theBindingContext
to the rules he's managing.The result was that
BooleanPropertyNaming
was effectively not running at all. This PR is fixing it.