-
-
Notifications
You must be signed in to change notification settings - Fork 823
Apply more formatting rules to our code #3615
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.