Skip to content

Commit e0b0229

Browse files
authored
Merge branch 'main' into support-google-java-format-format-javadoc-option
2 parents c3f2862 + 00b9f77 commit e0b0229

File tree

78 files changed

+2749
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2749
-755
lines changed

CHANGES.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111

1212
## [Unreleased]
1313
### Added
14-
* Added support for `google-java-format`'s `skip-javadoc-formatting` option. ([#1793](https://github.com/diffplug/spotless/pull/1793))
14+
* Add support for biome. The Rome project [was renamed to Biome](https://biomejs.dev/blog/annoucing-biome/).
15+
The configuration is still the same, but you should switch to the new `biome` tag / function and adjust
16+
the version accordingly. ([#1804](https://github.com/diffplug/spotless/issues/1804)).
17+
* Add support for `google-java-format`'s `skip-javadoc-formatting` option. ([#1793](https://github.com/diffplug/spotless/pull/1793))
1518
### Fixed
16-
* Added support for plugins when using Prettier version `3.0.0` and newer. ([#1802](https://github.com/diffplug/spotless/pull/1802))
19+
* Fix support for plugins when using Prettier version `3.0.0` and newer. ([#1802](https://github.com/diffplug/spotless/pull/1802))
20+
### Changes
21+
* Bump default `flexmark` version to latest `0.64.0` -> `0.64.8`. ([#1801](https://github.com/diffplug/spotless/pull/1801))
22+
* Bump default `ktlint` version to latest `0.50.0` -> `1.0.0`. ([#1808](https://github.com/diffplug/spotless/pull/1808))
1723

1824
## [2.41.0] - 2023-08-29
1925
### Added

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ lib('kotlin.KtLintStep') +'{{yes}} | {{yes}}
9494
lib('kotlin.KtfmtStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9595
lib('kotlin.DiktatStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9696
lib('markdown.FreshMarkStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
97-
lib('markdown.FlexmarkStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
97+
lib('markdown.FlexmarkStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9898
lib('npm.EslintFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9999
lib('npm.PrettierFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
100100
lib('npm.TsFmtFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
101101
lib('pom.SortPomStepStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
102102
lib('protobuf.BufStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
103103
lib('python.BlackStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
104-
lib('rome.RomeStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
104+
lib('biome.BiomeStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
105105
lib('scala.ScalaFmtStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
106106
lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
107107
extra('wtp.EclipseWtpFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
@@ -146,14 +146,14 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}}
146146
| [`kotlin.KtfmtStep`](lib/src/main/java/com/diffplug/spotless/kotlin/KtfmtStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
147147
| [`kotlin.DiktatStep`](lib/src/main/java/com/diffplug/spotless/kotlin/DiktatStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
148148
| [`markdown.FreshMarkStep`](lib/src/main/java/com/diffplug/spotless/markdown/FreshMarkStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
149-
| [`markdown.FlexmarkStep`](lib/src/main/java/com/diffplug/spotless/markdown/FlexmarkStep.java) | :white_large_square: | :+1: | :white_large_square: | :white_large_square: |
149+
| [`markdown.FlexmarkStep`](lib/src/main/java/com/diffplug/spotless/markdown/FlexmarkStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
150150
| [`npm.EslintFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
151151
| [`npm.PrettierFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
152152
| [`npm.TsFmtFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
153153
| [`pom.SortPomStepStep`](lib/src/main/java/com/diffplug/spotless/pom/SortPomStepStep.java) | :white_large_square: | :+1: | :white_large_square: | :white_large_square: |
154154
| [`protobuf.BufStep`](lib/src/main/java/com/diffplug/spotless/protobuf/BufStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
155155
| [`python.BlackStep`](lib/src/main/java/com/diffplug/spotless/python/BlackStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
156-
| [`rome.RomeStep`](lib/src/main/java/com/diffplug/spotless/rome/RomeStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
156+
| [`biome.BiomeStep`](lib/src/main/java/com/diffplug/spotless/biome/BiomeStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
157157
| [`scala.ScalaFmtStep`](lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
158158
| [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/diffplug/spotless/sql/DBeaverSQLFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
159159
| [`wtp.EclipseWtpFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/wtp/EclipseWtpFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |

_ext/gradle/java-setup.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tasks.withType(JavaCompile).configureEach {
1919
dependencies {
2020
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2121
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
22-
testImplementation project(':testlib')
22+
testImplementation projects.testlib
2323
}
2424

2525
tasks.withType(Test).configureEach {

lib-extra/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version = rootProject.spotlessChangelog.versionNext
77
apply from: rootProject.file('gradle/java-setup.gradle')
88
apply from: rootProject.file('gradle/java-publish.gradle')
99

10-
String VER_SOLSTICE = '1.3.1'
10+
String VER_SOLSTICE = '1.7.3'
1111
dependencies {
12-
api project(':lib')
12+
api projects.lib
1313
// misc useful utilities
1414
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
1515
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
@@ -20,7 +20,7 @@ dependencies {
2020
implementation "dev.equo.ide:solstice:${VER_SOLSTICE}"
2121

2222
// testing
23-
testImplementation project(':testlib')
23+
testImplementation projects.testlib
2424
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2525
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
2626
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"

lib/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ versionCompatibility {
4848
'0.48.0',
4949
'0.49.0',
5050
'0.50.0',
51+
'1.0.0',
5152
]
5253
targetSourceSetName = 'ktlint'
5354
}
@@ -104,10 +105,14 @@ dependencies {
104105
compatKtLint0Dot49Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:0.49.0'
105106
compatKtLint0Dot49Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.49.0'
106107
compatKtLint0Dot49Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
107-
// ktlint latest supported version
108+
// ktlint previous supported version
108109
compatKtLint0Dot50Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:0.50.0'
109110
compatKtLint0Dot50Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.50.0'
110111
compatKtLint0Dot50Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
112+
// ktlint latest supported version
113+
compatKtLint1Dot0Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:1.0.0'
114+
compatKtLint1Dot0Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:1.0.0'
115+
compatKtLint1Dot0Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
111116
// palantirJavaFormat
112117
palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm
113118
// scalafmt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
/*
2+
* Copyright 2023 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.glue.ktlint.compat;
17+
18+
import java.nio.file.Files;
19+
import java.nio.file.Path;
20+
import java.util.ArrayList;
21+
import java.util.Collections;
22+
import java.util.List;
23+
import java.util.Map;
24+
import java.util.Objects;
25+
import java.util.ServiceLoader;
26+
import java.util.Set;
27+
import java.util.stream.Collectors;
28+
import java.util.stream.Stream;
29+
30+
import org.slf4j.Logger;
31+
import org.slf4j.LoggerFactory;
32+
33+
import com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3;
34+
import com.pinterest.ktlint.rule.engine.api.Code;
35+
import com.pinterest.ktlint.rule.engine.api.EditorConfigDefaults;
36+
import com.pinterest.ktlint.rule.engine.api.EditorConfigOverride;
37+
import com.pinterest.ktlint.rule.engine.api.KtLintRuleEngine;
38+
import com.pinterest.ktlint.rule.engine.api.LintError;
39+
import com.pinterest.ktlint.rule.engine.core.api.Rule;
40+
import com.pinterest.ktlint.rule.engine.core.api.RuleId;
41+
import com.pinterest.ktlint.rule.engine.core.api.RuleProvider;
42+
import com.pinterest.ktlint.rule.engine.core.api.RuleSetId;
43+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.CodeStyleEditorConfigPropertyKt;
44+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EditorConfigProperty;
45+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EndOfLinePropertyKt;
46+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.IndentSizeEditorConfigPropertyKt;
47+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.IndentStyleEditorConfigPropertyKt;
48+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.InsertFinalNewLineEditorConfigPropertyKt;
49+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.MaxLineLengthEditorConfigPropertyKt;
50+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.RuleExecution;
51+
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.RuleExecutionEditorConfigPropertyKt;
52+
53+
import kotlin.Pair;
54+
import kotlin.Unit;
55+
import kotlin.jvm.functions.Function2;
56+
57+
public class KtLintCompat1Dot0Dot0Adapter implements KtLintCompatAdapter {
58+
59+
private static final Logger logger = LoggerFactory.getLogger(KtLintCompat1Dot0Dot0Adapter.class);
60+
61+
private static final List<EditorConfigProperty<?>> DEFAULT_EDITOR_CONFIG_PROPERTIES;
62+
63+
static {
64+
List<EditorConfigProperty<?>> list = new ArrayList<>();
65+
list.add(CodeStyleEditorConfigPropertyKt.getCODE_STYLE_PROPERTY());
66+
list.add(EndOfLinePropertyKt.getEND_OF_LINE_PROPERTY());
67+
list.add(IndentSizeEditorConfigPropertyKt.getINDENT_SIZE_PROPERTY());
68+
list.add(IndentStyleEditorConfigPropertyKt.getINDENT_STYLE_PROPERTY());
69+
list.add(InsertFinalNewLineEditorConfigPropertyKt.getINSERT_FINAL_NEWLINE_PROPERTY());
70+
list.add(MaxLineLengthEditorConfigPropertyKt.getMAX_LINE_LENGTH_PROPERTY());
71+
list.add(RuleExecutionEditorConfigPropertyKt.getEXPERIMENTAL_RULES_EXECUTION_PROPERTY());
72+
DEFAULT_EDITOR_CONFIG_PROPERTIES = Collections.unmodifiableList(list);
73+
}
74+
75+
static class FormatterCallback implements Function2<LintError, Boolean, Unit> {
76+
77+
@Override
78+
public Unit invoke(LintError lint, Boolean corrected) {
79+
if (!corrected) {
80+
KtLintCompatReporting.report(lint.getLine(), lint.getCol(), lint.getRuleId().getValue(), lint.getDetail());
81+
}
82+
return Unit.INSTANCE;
83+
}
84+
}
85+
86+
@Override
87+
public String format(final String text, Path path, final boolean isScript,
88+
Path editorConfigPath, final Map<String, String> userData,
89+
final Map<String, Object> editorConfigOverrideMap) {
90+
final FormatterCallback formatterCallback = new FormatterCallback();
91+
92+
Set<RuleProvider> allRuleProviders = ServiceLoader.load(RuleSetProviderV3.class, RuleSetProviderV3.class.getClassLoader())
93+
.stream()
94+
.flatMap(loader -> loader.get().getRuleProviders().stream())
95+
.collect(Collectors.toUnmodifiableSet());
96+
97+
EditorConfigOverride editorConfigOverride;
98+
if (editorConfigOverrideMap.isEmpty()) {
99+
editorConfigOverride = EditorConfigOverride.Companion.getEMPTY_EDITOR_CONFIG_OVERRIDE();
100+
} else {
101+
editorConfigOverride = createEditorConfigOverride(allRuleProviders.stream().map(
102+
RuleProvider::createNewRuleInstance).collect(Collectors.toList()),
103+
editorConfigOverrideMap);
104+
}
105+
EditorConfigDefaults editorConfig;
106+
if (editorConfigPath == null || !Files.exists(editorConfigPath)) {
107+
editorConfig = EditorConfigDefaults.Companion.getEMPTY_EDITOR_CONFIG_DEFAULTS();
108+
} else {
109+
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath, Collections.emptySet());
110+
}
111+
112+
return new KtLintRuleEngine(
113+
allRuleProviders,
114+
editorConfig,
115+
editorConfigOverride,
116+
false,
117+
path.getFileSystem())
118+
.format(Code.Companion.fromPath(path), formatterCallback);
119+
}
120+
121+
/**
122+
* Create EditorConfigOverride from user provided parameters.
123+
*/
124+
private static EditorConfigOverride createEditorConfigOverride(final List<Rule> rules, Map<String, Object> editorConfigOverrideMap) {
125+
// Get properties from rules in the rule sets
126+
Stream<EditorConfigProperty<?>> ruleProperties = rules.stream()
127+
.flatMap(rule -> rule.getUsesEditorConfigProperties().stream());
128+
129+
// Create a mapping of properties to their names based on rule properties and default properties
130+
Map<String, EditorConfigProperty<?>> supportedProperties = Stream
131+
.concat(ruleProperties, DEFAULT_EDITOR_CONFIG_PROPERTIES.stream())
132+
.distinct()
133+
.collect(Collectors.toMap(EditorConfigProperty::getName, property -> property));
134+
135+
// The default style had been changed from intellij_idea to ktlint_official in version 1.0.0
136+
if (!editorConfigOverrideMap.containsKey("ktlint_code_style")) {
137+
editorConfigOverrideMap.put("ktlint_code_style", "intellij_idea");
138+
}
139+
140+
// Create config properties based on provided property names and values
141+
@SuppressWarnings("unchecked")
142+
Pair<EditorConfigProperty<?>, ?>[] properties = editorConfigOverrideMap.entrySet().stream()
143+
.map(entry -> {
144+
EditorConfigProperty<?> property = supportedProperties.get(entry.getKey());
145+
146+
if (property == null && entry.getKey().startsWith("ktlint_")) {
147+
String[] parts = entry.getKey().substring(7).split("_", 2);
148+
if (parts.length == 1) {
149+
// convert ktlint_{ruleset} to RuleSetId
150+
RuleSetId id = new RuleSetId(parts[0]);
151+
property = RuleExecutionEditorConfigPropertyKt.createRuleSetExecutionEditorConfigProperty(id, RuleExecution.enabled);
152+
} else {
153+
// convert ktlint_{ruleset}_{rulename} to RuleId
154+
RuleId id = new RuleId(parts[0] + ":" + parts[1]);
155+
property = RuleExecutionEditorConfigPropertyKt.createRuleExecutionEditorConfigProperty(id, RuleExecution.enabled);
156+
}
157+
}
158+
159+
if (property == null) {
160+
return null;
161+
} else {
162+
return new Pair<>(property, entry.getValue());
163+
}
164+
})
165+
.filter(Objects::nonNull)
166+
.toArray(Pair[]::new);
167+
168+
return EditorConfigOverride.Companion.from(properties);
169+
}
170+
}

lib/src/ktlint/java/com/diffplug/spotless/glue/ktlint/KtlintFormatterFunc.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,28 @@ public class KtlintFormatterFunc implements FormatterFunc.NeedsFile {
3333

3434
public KtlintFormatterFunc(String version, boolean isScript, FileSignature editorConfigPath, Map<String, String> userData,
3535
Map<String, Object> editorConfigOverrideMap) {
36-
int minorVersion = Integer.parseInt(version.split("\\.")[1]);
37-
if (minorVersion >= 50) {
38-
// Fixed `RuleId` and `RuleSetId` issues
39-
// New argument to `EditorConfigDefaults.Companion.load(...)` for custom property type parsing
40-
// New argument to `new KtLintRuleEngine(...)` to fail on usage of `treeCopyHandler` extension point
41-
this.adapter = new KtLintCompat0Dot50Dot0Adapter();
42-
} else if (minorVersion == 49) {
43-
// Packages and modules moved around (`ktlint-core` -> `ktlint-rule-engine`)
44-
// Experimental ruleset was replaced by implementing `Rule.Experimental` and checking the `ktlint_experimental` `.editorconfig` property
45-
// `RuleId` and `RuleSetId` became inline classes (mangled to be unrepresentable in Java source code, so reflection is needed), tracked here: https://github.com/pinterest/ktlint/issues/2041
46-
this.adapter = new KtLintCompat0Dot49Dot0Adapter();
47-
} else if (minorVersion == 48) {
48-
// ExperimentalParams lost two constructor arguments, EditorConfigProperty moved to its own class
49-
this.adapter = new KtLintCompat0Dot48Dot0Adapter();
36+
String[] versions = version.split("\\.");
37+
int majorVersion = Integer.parseInt(versions[0]);
38+
int minorVersion = Integer.parseInt(versions[1]);
39+
if (majorVersion == 1) {
40+
this.adapter = new KtLintCompat1Dot0Dot0Adapter();
5041
} else {
51-
throw new IllegalStateException("Ktlint versions < 0.48.0 not supported!");
42+
if (minorVersion >= 50) {
43+
// Fixed `RuleId` and `RuleSetId` issues
44+
// New argument to `EditorConfigDefaults.Companion.load(...)` for custom property type parsing
45+
// New argument to `new KtLintRuleEngine(...)` to fail on usage of `treeCopyHandler` extension point
46+
this.adapter = new KtLintCompat0Dot50Dot0Adapter();
47+
} else if (minorVersion == 49) {
48+
// Packages and modules moved around (`ktlint-core` -> `ktlint-rule-engine`)
49+
// Experimental ruleset was replaced by implementing `Rule.Experimental` and checking the `ktlint_experimental` `.editorconfig` property
50+
// `RuleId` and `RuleSetId` became inline classes (mangled to be unrepresentable in Java source code, so reflection is needed), tracked here: https://github.com/pinterest/ktlint/issues/2041
51+
this.adapter = new KtLintCompat0Dot49Dot0Adapter();
52+
} else if (minorVersion == 48) {
53+
// ExperimentalParams lost two constructor arguments, EditorConfigProperty moved to its own class
54+
this.adapter = new KtLintCompat0Dot48Dot0Adapter();
55+
} else {
56+
throw new IllegalStateException("Ktlint versions < 0.48.0 not supported!");
57+
}
5258
}
5359
this.editorConfigPath = editorConfigPath;
5460
this.editorConfigOverrideMap = editorConfigOverrideMap;

lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public class KtLintStep {
3636
// prevent direct instantiation
3737
private KtLintStep() {}
3838

39-
private static final String DEFAULT_VERSION = "0.50.0";
39+
private static final String DEFAULT_VERSION = "1.0.0";
4040
static final String NAME = "ktlint";
41-
static final String PACKAGE = "com.pinterest";
42-
static final String MAVEN_COORDINATE = PACKAGE + ":ktlint:";
41+
static final String MAVEN_COORDINATE_0_DOT = "com.pinterest:ktlint:";
42+
static final String MAVEN_COORDINATE_1_DOT = "com.pinterest.ktlint:ktlint-cli:";
4343

4444
public static FormatterStep create(Provisioner provisioner) {
4545
return create(defaultVersion(), provisioner);
@@ -110,7 +110,8 @@ static final class State implements Serializable {
110110
this.version = version;
111111
this.userData = new TreeMap<>(userData);
112112
this.editorConfigOverride = new TreeMap<>(editorConfigOverride);
113-
this.jarState = JarState.from(MAVEN_COORDINATE + version, provisioner);
113+
this.jarState = JarState.from((version.startsWith("0.") ? MAVEN_COORDINATE_0_DOT : MAVEN_COORDINATE_1_DOT) + version,
114+
provisioner);
114115
this.editorConfigPath = editorConfigPath;
115116
this.isScript = isScript;
116117
}

0 commit comments

Comments
 (0)