Skip to content

Commit ccf141e

Browse files
committed
Add ktlint test to plugin-maven
This verifies that the previous fix which checks if ktlint_code_style is already defined in .editorconfig before overriding it works as expected in plugin-maven.
1 parent 0be12f5 commit ccf141e

File tree

1 file changed

+11
-0
lines changed
  • plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin

1 file changed

+11
-0
lines changed

plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin/KtlintTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ void testReadCodeStyleFromEditorConfigFile() throws Exception {
5555
checkIntellijIdeaStyle();
5656
}
5757

58+
@Test
59+
void testEditorConfigOverrideWithUnsetCodeStyleDoesNotOverrideEditorConfigCodeStyleWithDefault() throws Exception {
60+
setFile(".editorconfig").toResource("kotlin/ktlint/ktlint_official/.editorconfig");
61+
writePomWithKotlinSteps("<ktlint>\n" +
62+
" <editorConfigOverride>\n" +
63+
" <ktlint_test_key>true</ktlint_test_key>\n" +
64+
" </editorConfigOverride>\n" +
65+
"</ktlint>");
66+
checkKtlintOfficialStyle();
67+
}
68+
5869
@Test
5970
void testSetEditorConfigCanOverrideEditorConfigFile() throws Exception {
6071
setFile(".editorconfig").toResource("kotlin/ktlint/intellij_idea/.editorconfig");

0 commit comments

Comments
 (0)