Apply more formatting rules to our code#3615
Apply more formatting rules to our code#3615chao2zhang merged 4 commits intodetekt:mainfrom BraisGabin:format
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3615 +/- ##
============================================
+ Coverage 77.58% 78.23% +0.65%
Complexity 2832 2832
============================================
Files 465 465
Lines 8807 9121 +314
Branches 1720 1722 +2
============================================
+ Hits 6833 7136 +303
- Misses 1047 1059 +12
+ Partials 927 926 -1
Continue to review full report at Codecov.
|
This is what I have observed as well in other projects |
|
|
||
| var shouldValidateBeforeAnalysis: Boolean = true | ||
| var knownPatterns: Collection<String> = emptyList() | ||
|
|
There was a problem hiding this comment.
Is this empty line addition done by autoCorrection from formatting rules? This is a little bit surprising if this is true.
There was a problem hiding this comment.
Yes, it is. I just did it again and this is a funny case... I needed to run detekt twice in this file to get the formatting rules happy... this seems like a bug.
| subject.compileAndLint( | ||
| """ | ||
| class A | ||
| """)).hasSize(1) | ||
| """ |
There was a problem hiding this comment.
The multi-line string looks worse in my opinion. But we can always manually fix these as a follow-up
Fixes #3593
I enabled more formatting rules for this project and run detekt with autocorrect. Then I run ktlint 0.41.0 with the
--experimentalargument and push the changes that doesn't conflict with the current rules. And finally I fixed some minor style things manually.I can't enable the rules:
ArgumentListWrappingbecause it have conflicts withIndentationAnnotationOnSeparateLinebecause it have false positives.