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
NonBooleanPropertyPrefixedWithIs: Allow boolean function reference #4684
NonBooleanPropertyPrefixedWithIs: Allow boolean function reference #4684
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4684 +/- ##
============================================
- Coverage 84.58% 84.58% -0.01%
- Complexity 3434 3441 +7
============================================
Files 492 492
Lines 11329 11335 +6
Branches 2058 2061 +3
============================================
+ Hits 9583 9588 +5
Misses 701 701
- Partials 1045 1046 +1
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.
Thanks @kvn-stgl for the nice contribution!
May I ask you to correct the used code snippets in the tests, so that those two code snippets are actually valid Kotlin code. This repo runs compile checks on CI for snippets in tests. It would then make the CI green.
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 one!
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 one!
val isDebuggable get() = BuildConfig.DEBUG | ||
} | ||
""" | ||
val findings = subject.compileAndLintWithContext(env, code) |
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.
This one should be just lintWithContext
. You doesn't want to compile it because it is meant to no compile.
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.
You're right. Thanks for the hint!
…4684) * NonBooleanPropertyPrefixedWithIs: Allow boolean function reference properties * fix detekt * replace compileAndLintWithContext with lintWithContext
This PR will allow boolean function reference properties for the NonBooleanPropertyPrefixedWithIs rule. (And fix issue #4675).
It also fixes a little issue that unknown types are not null, the string is just empty. This should also fix issue #4674.