Skip to content

Commit ddaf8d4

Browse files
committed
Enum naming convention, EBiomeFlavor -> BiomeFlavor
1 parent 4a9e443 commit ddaf8d4

File tree

17 files changed

+44
-44
lines changed

17 files changed

+44
-44
lines changed

lib/src/main/java/com/diffplug/spotless/rome/EBiomeFlavor.java renamed to lib/src/main/java/com/diffplug/spotless/rome/BiomeFlavor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* <p>
2222
* Will be removed once the old Rome project is not supported anymore.
2323
*/
24-
public enum EBiomeFlavor {
24+
public enum BiomeFlavor {
2525
/** The new forked Biome project. */
2626
BIOME("biome", "1.2.0", "biome.json", "biome-%s-%s-%s",
2727
"https://github.com/biomejs/biome/releases/download/cli%%2Fv%s/biome-%s"),
@@ -42,7 +42,7 @@ public enum EBiomeFlavor {
4242
private final String shortName;
4343
private final String urlPattern;
4444

45-
EBiomeFlavor(String shortName, String defaultVersion, String configName, String downloadFilePattern,
45+
BiomeFlavor(String shortName, String defaultVersion, String configName, String downloadFilePattern,
4646
String urlPattern) {
4747
this.shortName = shortName;
4848
this.defaultVersion = defaultVersion;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ final class RomeExecutableDownloader {
7171

7272
private final Path downloadDir;
7373

74-
private final EBiomeFlavor flavor;
74+
private final BiomeFlavor flavor;
7575

7676
/**
7777
* Creates a new downloader for the Biome executable. The executable files are
@@ -80,7 +80,7 @@ final class RomeExecutableDownloader {
8080
* @param flavor Flavor of Biome to use.
8181
* @param downloadDir Directory where to store the downloaded executable.
8282
*/
83-
public RomeExecutableDownloader(EBiomeFlavor flavor, Path downloadDir) {
83+
public RomeExecutableDownloader(BiomeFlavor flavor, Path downloadDir) {
8484
this.flavor = flavor;
8585
this.downloadDir = downloadDir;
8686
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class RomeStep {
7474
* Biome flavor to use. Will be removed once we stop supporting the deprecated Rome project.
7575
*/
7676
@Deprecated
77-
private final EBiomeFlavor flavor;
77+
private final BiomeFlavor flavor;
7878

7979
/**
8080
* Path to the Biome executable. Can be <code>null</code>, but either a path to
@@ -113,7 +113,7 @@ public String name() {
113113
* @param downloadDir Directory where to place the downloaded executable.
114114
* @return A new Biome step that download the executable from the network.
115115
*/
116-
public static RomeStep withExeDownload(EBiomeFlavor flavor, String version, String downloadDir) {
116+
public static RomeStep withExeDownload(BiomeFlavor flavor, String version, String downloadDir) {
117117
return new RomeStep(flavor, version, null, downloadDir);
118118
}
119119

@@ -125,7 +125,7 @@ public static RomeStep withExeDownload(EBiomeFlavor flavor, String version, Stri
125125
* @param pathToExe Path to the Biome executable to use.
126126
* @return A new Biome step that format with the given executable.
127127
*/
128-
public static RomeStep withExePath(EBiomeFlavor flavor, String pathToExe) {
128+
public static RomeStep withExePath(BiomeFlavor flavor, String pathToExe) {
129129
return new RomeStep(flavor, null, pathToExe, null);
130130
}
131131

@@ -154,7 +154,7 @@ private static void attemptToAddPosixPermission(Path file, PosixFilePermission p
154154
*
155155
* @return The default version for Biome.
156156
*/
157-
private static String defaultVersion(EBiomeFlavor flavor) {
157+
private static String defaultVersion(BiomeFlavor flavor) {
158158
return flavor.defaultVersion();
159159
}
160160

@@ -198,7 +198,7 @@ private static String resolveNameAgainstPath(String name) throws IOException, In
198198
* Checks the Biome config path. When the config path does not exist or when it
199199
* does not contain a file named {@code biome.json}, an error is thrown.
200200
*/
201-
private static void validateBiomeConfigPath(EBiomeFlavor flavor, String configPath) {
201+
private static void validateBiomeConfigPath(BiomeFlavor flavor, String configPath) {
202202
if (configPath == null) {
203203
return;
204204
}
@@ -230,7 +230,7 @@ private static void validateBiomeExecutable(String resolvedPathToExe) {
230230
* @param pathToExe Path to the Biome executable to use.
231231
* @param downloadDir Directory where to place the downloaded executable.
232232
*/
233-
private RomeStep(EBiomeFlavor flavor, String version, String pathToExe, String downloadDir) {
233+
private RomeStep(BiomeFlavor flavor, String version, String pathToExe, String downloadDir) {
234234
this.flavor = flavor;
235235
this.version = version != null && !version.isBlank() ? version : defaultVersion(flavor);
236236
this.pathToExe = pathToExe;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
import com.diffplug.spotless.generic.TrimTrailingWhitespaceStep;
6868
import com.diffplug.spotless.npm.NpmPathResolver;
6969
import com.diffplug.spotless.npm.PrettierFormatterStep;
70-
import com.diffplug.spotless.rome.EBiomeFlavor;
70+
import com.diffplug.spotless.rome.BiomeFlavor;
7171

7272
import groovy.lang.Closure;
7373

@@ -740,7 +740,7 @@ public class BiomeGeneric extends RomeStepConfig<BiomeGeneric> {
740740
* <code>null</code>.
741741
*/
742742
public BiomeGeneric(String version) {
743-
super(getProject(), FormatExtension.this::replaceStep, EBiomeFlavor.BIOME, version);
743+
super(getProject(), FormatExtension.this::replaceStep, BiomeFlavor.BIOME, version);
744744
}
745745

746746
/**
@@ -799,7 +799,7 @@ public class RomeGeneric extends RomeStepConfig<RomeGeneric> {
799799
* <code>null</code>.
800800
*/
801801
public RomeGeneric(String version) {
802-
super(getProject(), FormatExtension.this::replaceStep, EBiomeFlavor.ROME, version);
802+
super(getProject(), FormatExtension.this::replaceStep, BiomeFlavor.ROME, version);
803803
}
804804

805805
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import com.diffplug.spotless.npm.EslintFormatterStep;
3535
import com.diffplug.spotless.npm.NpmPathResolver;
3636
import com.diffplug.spotless.npm.PrettierFormatterStep;
37-
import com.diffplug.spotless.rome.EBiomeFlavor;
37+
import com.diffplug.spotless.rome.BiomeFlavor;
3838

3939
public class JavascriptExtension extends FormatExtension {
4040

@@ -193,7 +193,7 @@ public class BiomeJs extends RomeStepConfig<BiomeJs> {
193193
* @param version Biome version to use.
194194
*/
195195
public BiomeJs(String version) {
196-
super(getProject(), JavascriptExtension.this::replaceStep, EBiomeFlavor.BIOME, version);
196+
super(getProject(), JavascriptExtension.this::replaceStep, BiomeFlavor.BIOME, version);
197197
}
198198

199199
@Override
@@ -221,7 +221,7 @@ public class RomeJs extends RomeStepConfig<RomeJs> {
221221
* @param version Rome version to use.
222222
*/
223223
public RomeJs(String version) {
224-
super(getProject(), JavascriptExtension.this::replaceStep, EBiomeFlavor.ROME, version);
224+
super(getProject(), JavascriptExtension.this::replaceStep, BiomeFlavor.ROME, version);
225225
}
226226

227227
@Override

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import com.diffplug.spotless.json.JsonPatchStep;
2828
import com.diffplug.spotless.json.JsonSimpleStep;
2929
import com.diffplug.spotless.json.gson.GsonStep;
30-
import com.diffplug.spotless.rome.EBiomeFlavor;
30+
import com.diffplug.spotless.rome.BiomeFlavor;
3131

3232
public class JsonExtension extends FormatExtension {
3333
private static final int DEFAULT_INDENTATION = 4;
@@ -217,7 +217,7 @@ public class BiomeJson extends RomeStepConfig<BiomeJson> {
217217
* @param version Biome version to use.
218218
*/
219219
public BiomeJson(String version) {
220-
super(getProject(), JsonExtension.this::replaceStep, EBiomeFlavor.BIOME, version);
220+
super(getProject(), JsonExtension.this::replaceStep, BiomeFlavor.BIOME, version);
221221
}
222222

223223
@Override
@@ -245,7 +245,7 @@ public class RomeJson extends RomeStepConfig<RomeJson> {
245245
* @param version Rome version to use.
246246
*/
247247
public RomeJson(String version) {
248-
super(getProject(), JsonExtension.this::replaceStep, EBiomeFlavor.ROME, version);
248+
super(getProject(), JsonExtension.this::replaceStep, BiomeFlavor.ROME, version);
249249
}
250250

251251
@Override

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.gradle.api.artifacts.repositories.MavenArtifactRepository;
2929

3030
import com.diffplug.spotless.FormatterStep;
31-
import com.diffplug.spotless.rome.EBiomeFlavor;
31+
import com.diffplug.spotless.rome.BiomeFlavor;
3232
import com.diffplug.spotless.rome.RomeStep;
3333

3434
public abstract class RomeStepConfig<Self extends RomeStepConfig<Self>> {
@@ -54,7 +54,7 @@ public abstract class RomeStepConfig<Self extends RomeStepConfig<Self>> {
5454
* The flavor of Biome to use. Will be removed when we stop support the
5555
* deprecated Rome project.
5656
*/
57-
private final EBiomeFlavor flavor;
57+
private final BiomeFlavor flavor;
5858

5959
/**
6060
* Optional path to the Biome executable. Either a <code>version</code> or a
@@ -95,7 +95,7 @@ public abstract class RomeStepConfig<Self extends RomeStepConfig<Self>> {
9595
@Nullable
9696
private String version;
9797

98-
protected RomeStepConfig(Project project, Consumer<FormatterStep> replaceStep, EBiomeFlavor flavor,
98+
protected RomeStepConfig(Project project, Consumer<FormatterStep> replaceStep, BiomeFlavor flavor,
9999
String version) {
100100
this.project = requireNonNull(project);
101101
this.replaceStep = requireNonNull(replaceStep);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import com.diffplug.spotless.npm.TsConfigFileType;
3939
import com.diffplug.spotless.npm.TsFmtFormatterStep;
4040
import com.diffplug.spotless.npm.TypedTsFmtConfigFile;
41-
import com.diffplug.spotless.rome.EBiomeFlavor;
41+
import com.diffplug.spotless.rome.BiomeFlavor;
4242

4343
public class TypescriptExtension extends FormatExtension {
4444

@@ -278,7 +278,7 @@ public class BiomeTs extends RomeStepConfig<BiomeTs> {
278278
* @param version Biome version to use.
279279
*/
280280
public BiomeTs(String version) {
281-
super(getProject(), TypescriptExtension.this::replaceStep, EBiomeFlavor.BIOME, version);
281+
super(getProject(), TypescriptExtension.this::replaceStep, BiomeFlavor.BIOME, version);
282282
}
283283

284284
@Override
@@ -306,7 +306,7 @@ public class RomeTs extends RomeStepConfig<RomeTs> {
306306
* @param version Rome version to use.
307307
*/
308308
public RomeTs(String version) {
309-
super(getProject(), TypescriptExtension.this::replaceStep, EBiomeFlavor.ROME, version);
309+
super(getProject(), TypescriptExtension.this::replaceStep, BiomeFlavor.ROME, version);
310310
}
311311

312312
@Override

plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/Biome.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.apache.maven.plugins.annotations.Parameter;
1919

2020
import com.diffplug.spotless.maven.rome.AbstractRome;
21-
import com.diffplug.spotless.rome.EBiomeFlavor;
21+
import com.diffplug.spotless.rome.BiomeFlavor;
2222

2323
/**
2424
* Generic Biome formatter step that detects the language of the input file from
@@ -27,7 +27,7 @@
2727
*/
2828
public class Biome extends AbstractRome {
2929
public Biome() {
30-
super(EBiomeFlavor.BIOME);
30+
super(BiomeFlavor.BIOME);
3131
}
3232

3333
/**

plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/Rome.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
import org.apache.maven.plugins.annotations.Parameter;
1919

2020
import com.diffplug.spotless.maven.rome.AbstractRome;
21-
import com.diffplug.spotless.rome.EBiomeFlavor;
21+
import com.diffplug.spotless.rome.BiomeFlavor;
2222

2323
/**
2424
* See {@link Biome}.
2525
* @deprecated Rome has transitioned to Biome. This will be removed shortly.
2626
*/
2727
public class Rome extends AbstractRome {
2828
public Rome() {
29-
super(EBiomeFlavor.ROME);
29+
super(BiomeFlavor.ROME);
3030
}
3131

3232
/**

0 commit comments

Comments
 (0)