Handle case when reference is provided#8895
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8895 +/- ##
============================================
+ Coverage 85.36% 85.38% +0.01%
- Complexity 4383 4386 +3
============================================
Files 570 570
Lines 12557 12559 +2
Branches 2625 2627 +2
============================================
+ Hits 10719 10723 +4
Misses 695 695
+ Partials 1143 1141 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
abedf35 to
20cee7a
Compare
| val qualifiedName = privateProperty.qualifiedName() | ||
| val matchesPublicProperty = publicPropertyNames.contains(qualifiedName) | ||
| if (!matchesPublicProperty && comment.contains("[$qualifiedName]")) { | ||
| if (!matchesPublicProperty && comment.contains("\\[${Regex.escape(qualifiedName)}](?!\\[.*])".toRegex())) { |
There was a problem hiding this comment.
Is it possible to solve this somehow without regular expression?
The reason for asking is that this is potentially a very expensive operation to recompile the regex in each loop iteration.
There was a problem hiding this comment.
I have removed the regex. There could be false negatives, for example when there is an opening [ without a closing one, but I believe such cases will be very rare. If the need arises, we can address it at that time.
| klass.registerProperty(parameter) | ||
| } | ||
| } | ||
| }, |
| } | ||
|
|
||
| @Test | ||
| fun `does not report when ref is used with fully qualifies name same as private property`() { |
There was a problem hiding this comment.
| fun `does not report when ref is used with fully qualifies name same as private property`() { | |
| fun `does not report when ref is used with fully qualified name same as private property`() { |
| fun `does not report when ref is used with fully qualifies name same as private property`() { | ||
| val code = """ | ||
| /** | ||
| * This is wrapper which internally maintains a [list][java.util.LinkedList] variable |
There was a problem hiding this comment.
| * This is wrapper which internally maintains a [list][java.util.LinkedList] variable | |
| * This is a wrapper which internally maintains a [list][java.util.LinkedList] variable |
c084319 to
6e45649
Compare
6e45649 to
b16a6f5
Compare
|
Hi @schalkms should we merge this PR? |
Fixes #8893