- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 794
Bump KtLint to 0.43.2 and add TrailingComma rule #4227
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 #4227 +/- ##
============================================
+ Coverage 84.28% 84.34% +0.06%
- Complexity 3282 3299 +17
============================================
Files 474 473 -1
Lines 10429 10533 +104
Branches 1861 1885 +24
============================================
+ Hits 8790 8884 +94
- Misses 670 671 +1
- Partials 969 978 +9
Continue to review full report at Codecov.
|
Funnily enough that exact feedback was also provided on the ktlint issue, and they said they followed the terminology used in IntelliJ (which also says "allow" but acts as "require"). So all tooling is going to have a confusing name for this but at least it's consistent :/ IMHO it's better to change the name of the config option to reflect the effect it has. |
I would agree on this, if this would be a Detekt first party rule. But as we're wrapping a 3rd party rule, let's stick to the naming already decided by others. |
I vote to don't merge until those regressions are fixed. |
Another possible issue - fyi pinterest/ktlint#1274 |
Added to the list 👍 |
the reasoning behind that is we want a centralized configuration for both ktlint and IJ (so they don't conflict and confuse people) which appears to be |
It's been 6 weeks and not much movement on those regressions. Generally we are prompt at updating dependencies and we don't directly control what happens in ktlint, perhaps it's best to update but make sure docs make clear how ktlint version can be overridden when using the wrapper? |
...-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingComma.kt
Outdated
Show resolved
Hide resolved
…formatting/wrappers/TrailingComma.kt Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
Agree. I think it's safe to merge this. Should a point release on KtLint's end happen, we're going to include it inside |
See https://github.com/pinterest/ktlint/releases/tag/0.43.0 for the full release note. I've also wrapped the new experimental
TrailingComma
rule.I have to mention that I'm not entirely happy with the naming of the config keys:
As the rule is doing more than just allowing. Setting the value to
true
is effectively enforcing trailing commas, while setting it tofalse
(the default) is forbidding it. I've anyway followed the same name that ktlint is having.Plus there seems to be some regressions on KtLint 0.43.0:
--add-opens
to work in JDK 16+ pinterest/ktlint#1274Fixes #2398