Skip to content

Commit a1d3aae

Browse files
committed
Remove all the deprecated rome stuff.
1 parent 4c06539 commit a1d3aae

File tree

16 files changed

+9
-1241
lines changed

16 files changed

+9
-1241
lines changed

lib/src/main/java/com/diffplug/spotless/rome/BiomeFlavor.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,17 +24,7 @@
2424
public enum BiomeFlavor {
2525
/** The new forked Biome project. */
2626
BIOME("biome", "1.2.0", "biome.json", "biome-%s-%s-%s",
27-
"https://github.com/biomejs/biome/releases/download/cli%%2Fv%s/biome-%s"),
28-
29-
/**
30-
* The old deprecated Rome project.
31-
*
32-
* @deprecated Will be removed once the old Rome project is not supported
33-
* anymore.
34-
*/
35-
@Deprecated
36-
ROME("rome", "12.0.0", "rome.json", "rome-%s-%s-%s",
37-
"https://github.com/rome/tools/releases/download/cli%%2Fv%s/rome-%s");
27+
"https://github.com/biomejs/biome/releases/download/cli%%2Fv%s/biome-%s");
3828

3929
private final String configName;
4030
private final String defaultVersion;

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -779,65 +779,6 @@ protected BiomeGeneric getThis() {
779779
}
780780
}
781781

782-
/**
783-
* Generic Rome formatter step that detects the language of the input file from
784-
* the file name. It should be specified as a formatter step for a generic
785-
* <code>format{ ... }</code>.
786-
*
787-
* @deprecated Rome has transitioned to Biome. This will be removed shortly.
788-
*/
789-
@Deprecated
790-
public class RomeGeneric extends RomeStepConfig<RomeGeneric> {
791-
@Nullable
792-
String language;
793-
794-
/**
795-
* Creates a new Rome config that downloads the Rome executable for the given
796-
* version from the network.
797-
*
798-
* @param version Rome version to use. The default version is used when
799-
* <code>null</code>.
800-
*/
801-
public RomeGeneric(String version) {
802-
super(getProject(), FormatExtension.this::replaceStep, BiomeFlavor.ROME, version);
803-
}
804-
805-
/**
806-
* Sets the language (syntax) of the input files to format. When
807-
* <code>null</code> or the empty string, the language is detected automatically
808-
* from the file name. Currently the following languages are supported by Rome:
809-
* <ul>
810-
* <li>js (JavaScript)</li>
811-
* <li>jsx (JavaScript + JSX)</li>
812-
* <li>js? (JavaScript or JavaScript + JSX, depending on the file
813-
* extension)</li>
814-
* <li>ts (TypeScript)</li>
815-
* <li>tsx (TypeScript + JSX)</li>
816-
* <li>ts? (TypeScript or TypeScript + JSX, depending on the file
817-
* extension)</li>
818-
* <li>json (JSON)</li>
819-
* </ul>
820-
*
821-
* @param language The language of the files to format.
822-
* @return This step for further configuration.
823-
*/
824-
public RomeGeneric language(String language) {
825-
this.language = language;
826-
replaceStep();
827-
return this;
828-
}
829-
830-
@Override
831-
protected String getLanguage() {
832-
return language;
833-
}
834-
835-
@Override
836-
protected RomeGeneric getThis() {
837-
return this;
838-
}
839-
}
840-
841782
/** Uses the default version of prettier. */
842783
public PrettierConfig prettier() {
843784
return prettier(PrettierFormatterStep.defaultDevDependencies());
@@ -871,30 +812,6 @@ public RomeStepConfig<?> biome(String version) {
871812
return biomeConfig;
872813
}
873814

874-
/**
875-
* Defaults to downloading the default Rome version from the network. To work
876-
* offline, you can specify the path to the Rome executable via
877-
* {@code rome().pathToExe(...)}.
878-
*
879-
* @deprecated Use {@link #biome(String)}.
880-
*/
881-
@Deprecated
882-
public RomeStepConfig<?> rome() {
883-
return rome(null);
884-
}
885-
886-
/**
887-
* Downloads the given Rome version from the network.
888-
*
889-
* @deprecated Use {@link #biome(String)}.
890-
*/
891-
@Deprecated
892-
public RomeStepConfig<?> rome(String version) {
893-
var romeConfig = new RomeGeneric(version);
894-
addStep(romeConfig.createStep());
895-
return romeConfig;
896-
}
897-
898815
/** Uses the default version of clang-format. */
899816
public ClangFormatConfig clangFormat() {
900817
return clangFormat(ClangFormatStep.defaultVersion());

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JavascriptExtension.java

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -154,30 +154,6 @@ public BiomeJs biome(String version) {
154154
return biomeConfig;
155155
}
156156

157-
/**
158-
* Defaults to downloading the default Rome version from the network. To work
159-
* offline, you can specify the path to the Rome executable via
160-
* {@code rome().pathToExe(...)}.
161-
*
162-
* @deprecated Use {@link #biome()}.
163-
*/
164-
@Deprecated
165-
public RomeJs rome() {
166-
return rome(null);
167-
}
168-
169-
/**
170-
* Downloads the given Rome version from the network.
171-
*
172-
* @deprecated Use {@link #biome(String)}.
173-
*/
174-
@Deprecated
175-
public RomeJs rome(String version) {
176-
var romeConfig = new RomeJs(version);
177-
addStep(romeConfig.createStep());
178-
return romeConfig;
179-
}
180-
181157
private static final String DEFAULT_PRETTIER_JS_PARSER = "babel";
182158
private static final ImmutableList<String> PRETTIER_JS_PARSERS = ImmutableList.of(DEFAULT_PRETTIER_JS_PARSER,
183159
"babel-flow", "flow");
@@ -207,34 +183,6 @@ protected BiomeJs getThis() {
207183
}
208184
}
209185

210-
/**
211-
* Rome formatter step for JavaScript.
212-
*
213-
* @deprecated Rome has transitioned to Biome. This will be removed shortly.
214-
*/
215-
@Deprecated
216-
public class RomeJs extends RomeStepConfig<RomeJs> {
217-
/**
218-
* Creates a new Rome formatter step config for formatting JavaScript files.
219-
* Unless overwritten, the given Rome version is downloaded from the network.
220-
*
221-
* @param version Rome version to use.
222-
*/
223-
public RomeJs(String version) {
224-
super(getProject(), JavascriptExtension.this::replaceStep, BiomeFlavor.ROME, version);
225-
}
226-
227-
@Override
228-
protected String getLanguage() {
229-
return "js?";
230-
}
231-
232-
@Override
233-
protected RomeJs getThis() {
234-
return this;
235-
}
236-
}
237-
238186
/**
239187
* Overrides the parser to be set to a js parser.
240188
*/

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JsonExtension.java

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -76,30 +76,6 @@ public BiomeJson biome(String version) {
7676
return biomeConfig;
7777
}
7878

79-
/**
80-
* Defaults to downloading the default Rome version from the network. To work
81-
* offline, you can specify the path to the Rome executable via
82-
* {@code rome().pathToExe(...)}.
83-
*
84-
* @deprecated Use {@link #biome()}.
85-
*/
86-
@Deprecated
87-
public RomeJson rome() {
88-
return rome(null);
89-
}
90-
91-
/**
92-
* Downloads the given Rome version from the network.
93-
*
94-
* @deprecated Use {@link #biome(String)}.
95-
*/
96-
@Deprecated
97-
public RomeJson rome(String version) {
98-
var romeConfig = new RomeJson(version);
99-
addStep(romeConfig.createStep());
100-
return romeConfig;
101-
}
102-
10379
public JsonPatchConfig jsonPatch(List<Map<String, Object>> patch) {
10480
return new JsonPatchConfig(patch);
10581
}
@@ -231,34 +207,6 @@ protected BiomeJson getThis() {
231207
}
232208
}
233209

234-
/**
235-
* Rome formatter step for JSON.
236-
*
237-
* @deprecated Rome has transitioned to Biome. This will be removed shortly.
238-
*/
239-
@Deprecated
240-
public class RomeJson extends RomeStepConfig<RomeJson> {
241-
/**
242-
* Creates a new Rome formatter step config for formatting JSON files. Unless
243-
* overwritten, the given Rome version is downloaded from the network.
244-
*
245-
* @param version Rome version to use.
246-
*/
247-
public RomeJson(String version) {
248-
super(getProject(), JsonExtension.this::replaceStep, BiomeFlavor.ROME, version);
249-
}
250-
251-
@Override
252-
protected String getLanguage() {
253-
return "json";
254-
}
255-
256-
@Override
257-
protected RomeJson getThis() {
258-
return this;
259-
}
260-
}
261-
262210
public class JsonPatchConfig {
263211
private String zjsonPatchVersion;
264212
private List<Map<String, Object>> patch;

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/TypescriptExtension.java

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -243,30 +243,6 @@ public BiomeTs biome(String version) {
243243
return biomeConfig;
244244
}
245245

246-
/**
247-
* Defaults to downloading the default Rome version from the network. To work
248-
* offline, you can specify the path to the Rome executable via
249-
* {@code rome().pathToExe(...)}.
250-
*
251-
* @deprecated Use {@link #biome()}.
252-
*/
253-
@Deprecated
254-
public RomeTs rome() {
255-
return rome(null);
256-
}
257-
258-
/**
259-
* Downloads the given Rome version from the network.
260-
*
261-
* @deprecated Use {@link #biome(String)}.
262-
*/
263-
@Deprecated
264-
public RomeTs rome(String version) {
265-
var romeConfig = new RomeTs(version);
266-
addStep(romeConfig.createStep());
267-
return romeConfig;
268-
}
269-
270246
/**
271247
* Biome formatter step for TypeScript.
272248
*/
@@ -292,34 +268,6 @@ protected BiomeTs getThis() {
292268
}
293269
}
294270

295-
/**
296-
* Rome formatter step for TypeScript.
297-
*
298-
* @deprecated Rome has transitioned to Biome. This will be removed shortly.
299-
*/
300-
@Deprecated
301-
public class RomeTs extends RomeStepConfig<RomeTs> {
302-
/**
303-
* Creates a new Rome formatter step config for formatting TypeScript files.
304-
* Unless overwritten, the given Rome version is downloaded from the network.
305-
*
306-
* @param version Rome version to use.
307-
*/
308-
public RomeTs(String version) {
309-
super(getProject(), TypescriptExtension.this::replaceStep, BiomeFlavor.ROME, version);
310-
}
311-
312-
@Override
313-
protected String getLanguage() {
314-
return "ts?";
315-
}
316-
317-
@Override
318-
protected RomeTs getThis() {
319-
return this;
320-
}
321-
}
322-
323271
@Override
324272
protected void setupTask(SpotlessTask task) {
325273
if (target == null) {

0 commit comments

Comments
 (0)