Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2025 DiffPlug
* Copyright 2023-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@ public final class BiomeSettings {
private static final Logger LOGGER = LoggerFactory.getLogger(BiomeSettings.class);

private static final String CONFIG_NAME = "biome.json";
private static final String DEFAULT_VERSION = "1.2.0";
private static final String DEFAULT_VERSION = "2.3.11";
private static final String DOWNLOAD_FILE_PATTERN = "biome-%s-%s-%s";
private static final String SHORT_NAME = "biome";
private static final String URL_PATTERN_1X = "https://github.com/biomejs/biome/releases/download/cli%%2Fv%s/biome-%s";
Expand Down Expand Up @@ -58,7 +58,7 @@ public static String getDownloadFilePattern() {
}

/**
* @param version The biome version for which to get the URL pattern, e.g. 1.2.0 or 2.0.6.
* @param version The biome version for which to get the URL pattern, e.g. 1.8.3 or 2.3.11.
* @return The pattern for {@link String#formatted(Object...)
* String.format()} for the URL where the executables can be downloaded.
* The first parameter is the version, the second parameter is the OS /
Expand Down
6 changes: 4 additions & 2 deletions lib/src/main/java/com/diffplug/spotless/biome/BiomeStep.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2025 DiffPlug
* Copyright 2016-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -393,7 +393,9 @@ private String[] buildBiomeCommand(File file) {
var fileName = resolveFileName(file);
var argList = new ArrayList<String>();
argList.add(pathToExe);
argList.add("format");
argList.add("check");
argList.add("--write");
argList.add("--linter-enabled=false");
argList.add("--stdin-file-path");
argList.add(fileName);
if (configPath != null) {
Expand Down
1 change: 1 addition & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Changes
* Bump default `ktlint` version to latest `1.7.1` -> `1.8.0`. ([2763](https://github.com/diffplug/spotless/pull/2763))
* Bump default `gherkin-utils` version to latest `9.2.0` -> `10.0.0`. ([#2619](https://github.com/diffplug/spotless/pull/2619))
* Biome command changed to allow for configuring/running [Biome assists](https://biomejs.dev/assist/), such as `organizeImports`. ([#2801](https://github.com/diffplug/spotless/pull/2801))

## [8.1.0] - 2025-11-18
### Changes
Expand Down
6 changes: 3 additions & 3 deletions plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ To download the Biome binary from the network, just specify a version:
spotless {
format 'biome', {
target '**/*.js','**/*.ts','**/*.json'
biome('1.2.0')
biome('2.3.11')
}
}
```
Expand All @@ -1558,7 +1558,7 @@ spotless {
format 'biome', {
target '**/*.js','**/*.ts','**/*.json'
// Relative paths are resolved against the project's base directory
biome('1.2.0').downloadDir("${project.gradle.gradleUserHomeDir}/biome")
biome('2.3.11').downloadDir("${project.gradle.gradleUserHomeDir}/biome")
}
}
```
Expand Down Expand Up @@ -1639,7 +1639,7 @@ you can force a certain language like this:
spotless {
format 'biome', {
target 'src/**/typescript/**/*.mjson'
biome('1.2.0').language('json')
biome('2.3.11').language('json')
}
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2025 DiffPlug
* Copyright 2023-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -95,7 +95,7 @@ void asGenericStep() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0')",
" biome('2.3.11')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
Expand All @@ -120,7 +120,7 @@ void asJavaScriptStep() throws Exception {
"spotless {",
" javascript {",
" target '**/*.js'",
" biome('1.2.0')",
" biome('2.3.11')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
Expand All @@ -145,7 +145,7 @@ void asJsonStep() throws Exception {
"spotless {",
" json {",
" target '**/*.json'",
" biome('1.2.0')",
" biome('2.3.11')",
" }",
"}");
setFile("biome_test.json").toResource("biome/json/fileBefore.json");
Expand All @@ -170,7 +170,7 @@ void asTypeScriptStep() throws Exception {
"spotless {",
" typescript {",
" target '**/*.ts'",
" biome('1.2.0')",
" biome('2.3.11')",
" }",
"}");
setFile("biome_test.ts").toResource("biome/ts/fileBefore.ts");
Expand All @@ -195,7 +195,7 @@ void canSetLanguageForGenericStep() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.nosj'",
" biome('1.2.0').language('json')",
" biome('2.3.11').language('json')",
" }",
"}");
setFile("biome_test.nosj").toResource("biome/json/fileBefore.json");
Expand All @@ -221,7 +221,7 @@ void configPathAbsolute() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').configPath('" + Encode.forJava(path) + "')",
" biome('2.3.11').configPath('" + Encode.forJava(path) + "')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/longLineBefore.js");
Expand Down Expand Up @@ -276,7 +276,7 @@ void configPathLineWidth120() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').configPath('configs')",
" biome('2.3.11').configPath('configs')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/longLineBefore.js");
Expand All @@ -303,7 +303,7 @@ void configPathLineWidth80() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').configPath('configs')",
" biome('2.3.11').configPath('configs')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/longLineBefore.js");
Expand All @@ -330,7 +330,7 @@ void downloadDirAbsolute() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').downloadDir('" + Encode.forJava(path) + "')",
" biome('2.3.11').downloadDir('" + Encode.forJava(path) + "')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
Expand Down Expand Up @@ -358,7 +358,7 @@ void downloadDirRelative() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').downloadDir('target/bin/biome')",
" biome('2.3.11').downloadDir('target/bin/biome')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
Expand All @@ -385,7 +385,7 @@ void failureWhenExeNotFound() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').pathToExe('biome/is/missing')",
" biome('2.3.11').pathToExe('biome/is/missing')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
Expand All @@ -412,7 +412,7 @@ void failureWhenNotParseable() throws Exception {
"spotless {",
" format 'mybiome', {",
" target '**/*.js'",
" biome('1.2.0').language('json')",
" biome('2.3.11').language('json')",
" }",
"}");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
Expand Down Expand Up @@ -445,7 +445,7 @@ void preservesIgnoredFiles() throws Exception {
"spotless {",
" json {",
" target '**/*.json'",
" biome('1.5.0')",
" biome('1.8.0')",
" }",
"}");
setFile("package.json").toResource("biome/json/packageBefore.json");
Expand Down
2 changes: 2 additions & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Changes
* Bump default `ktlint` version to latest `1.7.1` -> `1.8.0`. ([2763](https://github.com/diffplug/spotless/pull/2763))
* Bump default `gherkin-utils` version to latest `9.2.0` -> `10.0.0`. ([#2619](https://github.com/diffplug/spotless/pull/2619))
* Biome command changed to allow for configuring/running [Biome assists](https://biomejs.dev/assist/), such as `organizeImports`. ([#2801](https://github.com/diffplug/spotless/pull/2801))


## [3.1.0] - 2025-11-18
### Changes
Expand Down
2 changes: 1 addition & 1 deletion plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ you can force a certain language like this:
</includes>

<biome>
<version>1.2.0</version>
<version>2.3.11</version>
<language>json</language>
</biome>
</format>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2025 DiffPlug
* Copyright 2023-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,7 +67,7 @@ void asCssStepStable() throws Exception {
*/
@Test
void asGenericStep() throws Exception {
writePomWithBiomeSteps("**/*.js", "<biome><version>1.2.0</version></biome>");
writePomWithBiomeSteps("**/*.js", "<biome><version>1.8.0</version></biome>");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
mavenRunner().withArguments("spotless:apply").runNoError();
assertFile("biome_test.js").sameAsResource("biome/js/fileAfter.js");
Expand All @@ -80,7 +80,7 @@ void asGenericStep() throws Exception {
*/
@Test
void asJavaScriptStep() throws Exception {
writePomWithJavascriptSteps("**/*.js", "<biome><version>1.2.0</version></biome>");
writePomWithJavascriptSteps("**/*.js", "<biome><version>1.8.0</version></biome>");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
mavenRunner().withArguments("spotless:apply").runNoError();
assertFile("biome_test.js").sameAsResource("biome/js/fileAfter.js");
Expand All @@ -93,7 +93,7 @@ void asJavaScriptStep() throws Exception {
*/
@Test
void asJsonStep() throws Exception {
writePomWithJsonSteps("**/*.json", "<biome><version>1.2.0</version></biome>");
writePomWithJsonSteps("**/*.json", "<biome><version>1.8.0</version></biome>");
setFile("biome_test.json").toResource("biome/json/fileBefore.json");
mavenRunner().withArguments("spotless:apply").runNoError();
assertFile("biome_test.json").sameAsResource("biome/json/fileAfter.json");
Expand All @@ -106,7 +106,7 @@ void asJsonStep() throws Exception {
*/
@Test
void asTypeScriptStep() throws Exception {
writePomWithTypescriptSteps("**/*.ts", "<biome><version>1.2.0</version></biome>");
writePomWithTypescriptSteps("**/*.ts", "<biome><version>1.8.0</version></biome>");
setFile("biome_test.ts").toResource("biome/ts/fileBefore.ts");
mavenRunner().withArguments("spotless:apply").runNoError();
assertFile("biome_test.ts").sameAsResource("biome/ts/fileAfter.ts");
Expand All @@ -119,7 +119,7 @@ void asTypeScriptStep() throws Exception {
*/
@Test
void canSetLanguageForGenericStep() throws Exception {
writePomWithBiomeSteps("**/*.nosj", "<biome><version>1.2.0</version><language>json</language></biome>");
writePomWithBiomeSteps("**/*.nosj", "<biome><version>1.8.0</version><language>json</language></biome>");
setFile("biome_test.nosj").toResource("biome/json/fileBefore.json");
mavenRunner().withArguments("spotless:apply").runNoError();
assertFile("biome_test.nosj").sameAsResource("biome/json/fileAfter.json");
Expand All @@ -134,7 +134,7 @@ void canSetLanguageForGenericStep() throws Exception {
void configPathAbsolute() throws Exception {
var path = newFile("configs").getAbsolutePath();
writePomWithBiomeSteps("**/*.js",
"<biome><version>1.2.0</version><configPath>" + forXml(path) + "</configPath></biome>");
"<biome><version>1.8.0</version><configPath>" + forXml(path) + "</configPath></biome>");
setFile("biome_test.js").toResource("biome/js/longLineBefore.js");
setFile("configs/biome.json").toResource("biome/config/line-width-120.json");
mavenRunner().withArguments("spotless:apply").runNoError();
Expand Down Expand Up @@ -166,7 +166,7 @@ void configPathFile() throws Exception {
*/
@Test
void configPathLineWidth120() throws Exception {
writePomWithBiomeSteps("**/*.js", "<biome><version>1.2.0</version><configPath>configs</configPath></biome>");
writePomWithBiomeSteps("**/*.js", "<biome><version>1.8.0</version><configPath>configs</configPath></biome>");
setFile("biome_test.js").toResource("biome/js/longLineBefore.js");
setFile("configs/biome.json").toResource("biome/config/line-width-120.json");
mavenRunner().withArguments("spotless:apply").runNoError();
Expand All @@ -181,7 +181,7 @@ void configPathLineWidth120() throws Exception {
*/
@Test
void configPathLineWidth80() throws Exception {
writePomWithBiomeSteps("**/*.js", "<biome><version>1.2.0</version><configPath>configs</configPath></biome>");
writePomWithBiomeSteps("**/*.js", "<biome><version>1.8.0</version><configPath>configs</configPath></biome>");
setFile("biome_test.js").toResource("biome/js/longLineBefore.js");
setFile("configs/biome.json").toResource("biome/config/line-width-80.json");
mavenRunner().withArguments("spotless:apply").runNoError();
Expand All @@ -197,7 +197,7 @@ void configPathLineWidth80() throws Exception {
void downloadDirAbsolute() throws Exception {
var path = newFile("target/bin/biome").getAbsoluteFile().toString();
writePomWithBiomeSteps("**/*.js",
"<biome><version>1.2.0</version><downloadDir>" + forXml(path) + "</downloadDir></biome>");
"<biome><version>1.8.0</version><downloadDir>" + forXml(path) + "</downloadDir></biome>");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
assertTrue(!newFile("target/bin/biome").exists() || newFile("target/bin/biome").list().length == 0);
mavenRunner().withArguments("spotless:apply").runNoError();
Expand All @@ -214,7 +214,7 @@ void downloadDirAbsolute() throws Exception {
@Test
void downloadDirRelative() throws Exception {
writePomWithBiomeSteps("**/*.js",
"<biome><version>1.2.0</version><downloadDir>target/bin/biome</downloadDir></biome>");
"<biome><version>1.8.0</version><downloadDir>target/bin/biome</downloadDir></biome>");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
assertTrue(!newFile("target/bin/biome").exists() || newFile("target/bin/biome").list().length == 0);
mavenRunner().withArguments("spotless:apply").runNoError();
Expand All @@ -229,7 +229,7 @@ void downloadDirRelative() throws Exception {
*/
@Test
void failureWhenExeNotFound() throws Exception {
writePomWithBiomeSteps("**/*.js", "<biome><version>1.2.0</version><pathToExe>biome/is/missing</pathToExe></biome>");
writePomWithBiomeSteps("**/*.js", "<biome><version>1.8.0</version><pathToExe>biome/is/missing</pathToExe></biome>");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
var result = mavenRunner().withArguments("spotless:apply").runHasError();
assertFile("biome_test.js").sameAsResource("biome/js/fileBefore.js");
Expand All @@ -243,7 +243,7 @@ void failureWhenExeNotFound() throws Exception {
*/
@Test
void failureWhenNotParseable() throws Exception {
writePomWithBiomeSteps("**/*.js", "<biome><version>1.2.0</version><language>json</language></biome>");
writePomWithBiomeSteps("**/*.js", "<biome><version>1.8.0</version><language>json</language></biome>");
setFile("biome_test.js").toResource("biome/js/fileBefore.js");
var result = mavenRunner().withArguments("spotless:apply").runHasError();
assertFile("biome_test.js").sameAsResource("biome/js/fileBefore.js");
Expand Down
Loading
Loading