-
Notifications
You must be signed in to change notification settings - Fork 460
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 maven coordinate (com.pinterest), default version (0.32.0) #394
Upgrade Ktlint maven coordinate (com.pinterest), default version (0.32.0) #394
Conversation
Is |
Here's how we resolved it for Ktlint-Gradle. Since Ktlint implements SemVer for all versioning, we imported a library that supports SemVer comparisons to handle all this logic. https://github.com/swiftzer/semver @nedtwigg I don't know if you have an existing methodology for doing SemVer comparisons. Don't know what your thoughts are on adding a library to handle this sort of thing. |
0.31.0 is the last of com.github.shyiko, 0.32.0 is the first for com.pinterest https://mvnrepository.com/artifact/com.github.shyiko/ktlint |
I'm against adding a dependency. Elsewhere in the code where we've had to change behavior based on a version, we've done feature-testing rather than version-testing, but that won't work here. Every |
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.
Thanks @sharedprophet! This looks great, I've got a minor nit on the implementation.
Only thing we need to merge is a test - need to make sure it works for 0.32.0
and 0.31.0
. Here's the existing test:
spotless/testlib/src/test/java/com/diffplug/spotless/kotlin/KtLintStepTest.java
Lines 27 to 39 in fd75332
@Test | |
public void behavior() throws Exception { | |
// Must use jcenter because `com.andreapivetta.kolor:kolor:0.0.2` isn't available on mavenCentral. | |
// It is a dependency of ktlint. | |
FormatterStep step = KtLintStep.create(TestProvisioner.jcenter()); | |
StepHarness.forStep(step) | |
.testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean") | |
.testException("kotlin/ktlint/unsolvable.dirty", assertion -> { | |
assertion.isInstanceOf(AssertionError.class); | |
assertion.hasMessage("Error on line: 1, column: 1\n" + | |
"Wildcard import"); | |
}); | |
} |
Maybe have a worksShyiko
test and a worksPinterest
test?
Also, we need to update |
I did update those... working on putting a test in the core tests now. |
LGTM, thanks! I'll let this breathe for 24 hrs then merge and release tomorrow. |
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.
LGTM! Looking forward to this.
Published in |
Update ktlint coords.