Repository navigation
Add configuration to add alternate trimming methods - #6063
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6063 +/- ##
=========================================
Coverage 84.86% 84.86%
- Complexity 3975 3977 +2
=========================================
Files 564 564
Lines 13300 13304 +4
Branches 2325 2327 +2
=========================================
+ Hits 11287 11291 +4
Misses 870 870
Partials 1143 1143
|
| private val indentSize by config(4) | ||
|
|
||
| @Configuration("allows to provide a list of multiline string trimming methods") | ||
| private val trimmingMethods: List<String> by config(listOf("trimIndent", "trimMargin")) |
There was a problem hiding this comment.
Should we use the method matcher that we have on forbidden method call? I assume it is not needed. If someone really needs it we could add it later without any breaking change.
There was a problem hiding this comment.
Hi, @BraisGabin this will change the old behaviour, initially, we used to allow any multiline sting with any method with name trimMargin method at the end. Now since we are asking for the FunctionMatcher that would mean that we are checking for function signature and hence the above-mentioned usage will be reported by the rule.
Also adding FunctionMatcher will need bindingContext to get the FqName of trimming method
There was a problem hiding this comment.
I wouldn't necessarily add bindingcontext here. IMHO, it doesn't add much value over using the current approach in this PR.
|
Waiting to ensure that at least one of the windows job work to merge it. We should work on the flakiness that we have on our rule set on windows. |
Fixes #5415