-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Upgrade ktlint to 0.40.0 #3281
Upgrade ktlint to 0.40.0 #3281
Conversation
...formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ImportOrdering.kt
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #3281 +/- ##
============================================
+ Coverage 80.32% 80.34% +0.02%
- Complexity 2721 2724 +3
============================================
Files 445 445
Lines 8168 8177 +9
Branches 1553 1555 +2
============================================
+ Hits 6561 6570 +9
Misses 774 774
Partials 833 833
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.
Cool, I like the simplification a lot!
I'm not sure how bad the regressions in pinterest/ktlint#997 and pinterest/ktlint#995 really are. |
I can test against my company's repo and give back the result. I am in no rush for this so 1.16 looks good to me. |
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.
Great cleanup :)
...formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ImportOrdering.kt
Show resolved
Hide resolved
I did some testing on my company's repo:
Most of the issues remained the same: The majority are Indentation, there are a few |
@chao2zhang can you fix the conflicts in this branch? This is ready to merge. |
…formatting/wrappers/ImportOrdering.kt Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
* Upgrade ktlint to 0.40.0 * Update detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ImportOrdering.kt Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com> * Fix merge conflict Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
* Upgrade ktlint to 0.40.0 * Update detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ImportOrdering.kt Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com> * Fix merge conflict Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
Motivation
Indentation
andParameterListWrapping
have had a regression since ktlint 0.37.0. ParameterListWrapping was fixed in 0.39.0 and Indentation was fixed in 0.40.0. Therefore, bumping the versions will benefit the users who have either of these rules active.Issue
pinterest/ktlint#874 and pinterest/ktlint#935 changed the implementation of
ImportOrdering
andFinalNewLine
to use the newEDITOR_CONFIG_PROPERTIES_USER_DATA_KEY
.Some of the data structures are qualified with internal, but since those rules are set back to alpha state, I put comments next to the hack so that we can reevaluate detekt code when those ktlint rules become stable.
In addition, I refactored
overrideEditorConfig()
andoverrideEditorConfigProperties()
to simplify the codeTesting
Most of the testing is done by running detekt task in detekt repo itself.
ImportOrdering
which are not active in default-detekt-config.yml, the code is working.ImportOrdering
andFinalNewLine
also have sufficient test coverage, so no new tests are added.