Skip to content

Commit 967825f

Browse files
committed
Update readme and changes for biome, #1804
1 parent a333813 commit 967825f

File tree

6 files changed

+143
-130
lines changed

6 files changed

+143
-130
lines changed

CHANGES.md

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

1212
## [Unreleased]
1313

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+
1418
### Fixed
1519
* Added support for plugins when using Prettier version `3.0.0` and newer. ([#1802](https://github.com/diffplug/spotless/pull/1802))
1620

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ lib('npm.TsFmtFormatterStep') +'{{yes}} | {{yes}}
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}} |',
@@ -153,7 +153,7 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}}
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: |

plugin-gradle/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
44

55
## [Unreleased]
66

7+
* Add support for biome. The Rome project [was renamed to Biome](https://biomejs.dev/blog/annoucing-biome/).
8+
The configuration is still the same, but you should switch to the new `biome(...)` function and adjust
9+
the version accordingly. ([#1804](https://github.com/diffplug/spotless/issues/1804)).
10+
711
### Fixed
812
* Added support for plugins when using Prettier version `3.0.0` and newer. ([#1802](https://github.com/diffplug/spotless/pull/1802))
913

plugin-gradle/README.md

Lines changed: 65 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
6464
- [FreshMark](#freshmark) aka markdown
6565
- [Antlr4](#antlr4) ([antlr4formatter](#antlr4formatter))
6666
- [SQL](#sql) ([dbeaver](#dbeaver), [prettier](#prettier))
67-
- [Typescript](#typescript) ([tsfmt](#tsfmt), [prettier](#prettier), [ESLint](#eslint-typescript), [Rome](#rome))
68-
- [Javascript](#javascript) ([prettier](#prettier), [ESLint](#eslint-javascript), [Rome](#rome))
69-
- [JSON](#json) ([simple](#simple), [gson](#gson), [jackson](#jackson), [rome](#rome), [jsonPatch](#jsonPatch))
67+
- [Typescript](#typescript) ([tsfmt](#tsfmt), [prettier](#prettier), [ESLint](#eslint-typescript), [Biome](#biome))
68+
- [Javascript](#javascript) ([prettier](#prettier), [ESLint](#eslint-javascript), [Biome](#biome))
69+
- [JSON](#json) ([simple](#simple), [gson](#gson), [jackson](#jackson), [Biome](#biome), [jsonPatch](#jsonPatch))
7070
- [YAML](#yaml)
7171
- [Gherkin](#gherkin)
7272
- Multiple languages
@@ -76,7 +76,7 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
7676
- c, c++, c#, objective-c, protobuf, javascript, java
7777
- [eclipse web tools platform](#eclipse-web-tools-platform)
7878
- css, html, js, json, xml
79-
- [Rome](#rome) ([binary detection](#rome-binary), [config file](#rome-configuration-file), [input language](#rome-input-language))
79+
- [Biome](#biome) ([binary detection](#biome-binary), [config file](#biome-configuration-file), [input language](#biome-input-language))
8080
- **Language independent**
8181
- [Generic steps](#generic-steps)
8282
- [License header](#license-header) ([slurp year from git](#retroactively-slurp-years-from-git-history))
@@ -650,7 +650,7 @@ spotless {
650650
tsfmt() // has its own section below
651651
prettier() // has its own section below
652652
eslint() // has its own section below
653-
rome() // has its own section below
653+
biome() // has its own section below
654654
655655
licenseHeader '/* (C) $YEAR */', '(import|const|declare|export|var) ' // or licenseHeaderFile
656656
// note the '(import|const|...' argument - this is a regex which identifies the top
@@ -743,7 +743,7 @@ spotless {
743743
744744
prettier() // has its own section below
745745
eslint() // has its own section below
746-
rome() // has its own section below
746+
biome() // has its own section below
747747
748748
licenseHeader '/* (C) $YEAR */', 'REGEX_TO_DEFINE_TOP_OF_FILE' // or licenseHeaderFile
749749
}
@@ -810,7 +810,7 @@ spotless {
810810
eclipseWtp('json') // see Eclipse web tools platform section
811811
gson() // has its own section below
812812
jackson() // has its own section below
813-
rome() // has its own section below
813+
biome() // has its own section below
814814
jsonPatch([]) // has its own section below
815815
}
816816
}
@@ -1150,15 +1150,20 @@ Unlike Eclipse, Spotless WTP ignores per default external URIs in schema locatio
11501150
external entities. To allow the access of external URIs, set the property `resolveExternalURI`
11511151
to true.
11521152
1153-
## Rome
1153+
## Biome
11541154
1155-
[homepage](https://rome.tools/). [changelog](https://github.com/rome/tools/blob/main/CHANGELOG.md). Rome is a formatter that for the Frontend written in Rust, which has a native binary,
1156-
does not require Node.js and as such, is pretty fast. It can currently format
1157-
JavaScript, TypeScript, JSX, and JSON, and may support
1158-
[more frontend languages](https://docs.rome.tools/internals/language_support/)
1159-
such as CSS in the future.
1155+
[homepage](https://biomejs.dev/). [changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG.md). Biome is
1156+
a formatter that for the frontend written in Rust, which has a native binary, does not require Node.js and as such,
1157+
is pretty fast. It can currently format JavaScript, TypeScript, JSX, and JSON, and may support
1158+
[more frontend languages](https://biomejs.dev/internals/language-support/) such as CSS in the future.
11601159
1161-
You can use rome in any language-specific format for supported languages, but
1160+
Note: Biome [was formerly called Rome](https://biomejs.dev/blog/annoucing-biome/). Configurations with
1161+
the old `<rome>` tag and `rome(...)` function are still supported for the time being. This will be removed
1162+
in a future version, you should migrate to the new `<biome>` tag or `biome(...)` function. The configuration
1163+
remains the same, you only need to update the version. If you are using a custom `rome.json` configuration file,
1164+
you need to rename it to `biome.json`.
1165+
1166+
You can use Biome in any language-specific format for supported languages, but
11621167
usually you will be creating a generic format.
11631168
11641169
```gradle
@@ -1167,72 +1172,73 @@ spotless {
11671172
// you have to set the target manually
11681173
target 'src/*/webapp/**/*.js'
11691174
1170-
// Download Rome from the network if not already downloaded, see below for more info
1171-
rome('12.0.0')
1175+
// Download Biome from the network if not already downloaded, see below for more info
1176+
biome('1.2.0')
11721177
1173-
// (optional) Path to the directory with the rome.json conig file
1174-
rome('12.0.0').configPath("path/config/dir")
1178+
// (optional) Path to the directory with the biome.json conig file
1179+
biome('1.2.0').configPath("path/config/dir")
11751180
1176-
// (optional) Rome will auto detect the language based on the file extension.
1181+
// (optional) Biome will auto detect the language based on the file extension.
11771182
// See below for possible values.
1178-
rome('12.0.0').language("js")
1183+
biome('1.2.0').language("js")
11791184
}
11801185
}
11811186
```
11821187
11831188
**Limitations:**
1189+
11841190
- The auto-discovery of config files (up the file tree) will not work when using
1185-
Rome within spotless.
1191+
Biome within spotless.
11861192
1187-
To apply Rome to more kinds of files with a different configuration, just add
1193+
To apply Biome to more kinds of files with a different configuration, just add
11881194
more formats:
11891195
11901196
```gradle
11911197
spotless {
1192-
format 'rome-js', {
1198+
format 'biome-js', {
11931199
target '**/*.js'
1194-
rome('12.0.0')
1200+
biome('1.2.0')
11951201
}
1196-
format 'rome-ts', {
1202+
format 'biome-ts', {
11971203
target '**/*.ts'
1198-
rome('12.0.0')
1204+
biome('1.2.0')
11991205
}
1200-
format 'rome-json', {
1206+
format 'biome-json', {
12011207
target '**/*.json'
1202-
rome('12.0.0')
1208+
biome('1.2.0')
12031209
}
12041210
}
12051211
```
12061212
1207-
### Rome binary
1213+
### Biome binary
12081214
1209-
To format with Rome, spotless needs to find the Rome binary. By default,
1215+
To format with Biome, spotless needs to find the Biome binary. By default,
12101216
spotless downloads the binary for the given version from the network. This
12111217
should be fine in most cases, but may not work e.g. when there is not connection
12121218
to the internet.
12131219
1214-
To download the Rome binary from the network, just specify a version:
1220+
To download the Biome binary from the network, just specify a version:
12151221
12161222
```gradle
12171223
spotless {
1218-
format 'rome', {
1224+
format 'biome', {
12191225
target '**/*.js','**/*.ts','**/*.json'
1220-
rome('12.0.0')
1226+
biome('1.2.0')
12211227
}
12221228
}
12231229
```
12241230
1225-
Spotless uses a default version when you do not specfiy a version, but this
1226-
may change at any time, so we recommend that you always set the Rome version
1231+
Spotless uses a default version when you do not specify a version, but this
1232+
may change at any time, so we recommend that you always set the Biome version
12271233
you want to use. Optionally, you can also specify a directory for the downloaded
1228-
Rome binaries (defaults to `~/.m2/repository/com/diffplug/spotless/spotless-data/rome`):
1234+
Biome binaries (defaults to `~/.m2/repository/com/diffplug/spotless/spotless-data/biome`):
12291235
12301236
```gradle
12311237
spotless {
1232-
format 'rome', {
1238+
format 'biome', {
12331239
target '**/*.js','**/*.ts','**/*.json'
12341240
// Relative paths are resolved against the project's base directory
1235-
rome('12.0.0').downloadDir("${project.gradle.gradleUserHomeDir}/rome")
1241+
biome('1.2.0').downloadDir("${project.gradle.gradleUserHomeDir}/biome")
12361242
}
12371243
}
12381244
```
@@ -1241,68 +1247,59 @@ To use a fixed binary, omit the `version` and specify a `pathToExe`:
12411247

12421248
```gradle
12431249
spotless {
1244-
format 'rome', {
1250+
format 'biome', {
12451251
target '**/*.js','**/*.ts','**/*.json'
1246-
rome().pathToExe("${project.layout.buildDirectory.asFile.get().absolutePath}/bin/rome")
1252+
biome().pathToExe("${project.layout.buildDirectory.asFile.get().absolutePath}/bin/biome")
12471253
}
12481254
}
12491255
```
12501256

12511257
Absolute paths are used as-is. Relative paths are resolved against the project's
1252-
base directory. To use a pre-installed Rome binary on the user's path, specify
1258+
base directory. To use a pre-installed Biome binary on the user's path, specify
12531259
just a name without any slashes / backslashes:
12541260

12551261
```gradle
12561262
spotless {
1257-
format 'rome', {
1263+
format 'biome', {
12581264
target '**/*.js','**/*.ts','**/*.json'
1259-
// Uses the "rome" command, which must be on the user's path. -->
1260-
rome().pathToExe('rome')
1265+
// Uses the "biome" command, which must be on the user's path. -->
1266+
biome().pathToExe('biome')
12611267
}
12621268
}
12631269
```
12641270

1265-
### Rome configuration file
1271+
### Biome configuration file
12661272

1267-
Rome is a biased formatter and linter without many options, but there are a few
1268-
basic options. Rome uses a file named [rome.json](https://docs.rome.tools/configuration/)
1273+
Biome is a biased formatter and linter without many options, but there are a few
1274+
basic options. Biome uses a file named [biome.json](https://biomejs.dev/reference/configuration/)
12691275
for its configuration. When none is specified, the default configuration from
1270-
Rome is used. To use a custom configuration:
1276+
Biome is used. To use a custom configuration:
12711277

12721278
```gradle
12731279
spotless {
1274-
format 'rome', {
1280+
format 'biome', {
12751281
target '**/*.js','**/*.ts','**/*.json'
1276-
// Must point to the directory with the "rome.json" config file -->
1282+
// Must point to the directory with the "biome.json" config file -->
12771283
// Relative paths are resolved against the project's base directory -->
1278-
rome('12.0.0').configPath('./config')
1284+
biome('1.2.0').configPath('./config')
12791285
}
12801286
}
12811287
```
12821288

1283-
### Rome input language
1289+
### Biome input language
12841290

1285-
By default, Rome detects the language / syntax of the files to format
1291+
By default, Biome detects the language / syntax of the files to format
12861292
automatically from the file extension. This may fail if your source code files
12871293
have unusual extensions for some reason. If you are using the generic format,
12881294
you can force a certain language like this:
12891295

12901296
```xml
1291-
<configuration>
1292-
<formats>
1293-
<format>
1294-
<includes>
1295-
<include>src/**/typescript/**/*.mjson</include>
1296-
</includes>
1297-
1298-
<rome>
1299-
<version>12.0.0</version>
1300-
<language>json</language>
1301-
</prettier>
1302-
</rome>
1303-
1304-
</formats>
1305-
</configuration>
1297+
spotless {
1298+
format 'biome', {
1299+
target 'src/**/typescript/**/*.mjson'
1300+
biome('1.2.0').language('json')
1301+
}
1302+
}
13061303
```
13071304

13081305
The following languages are currently recognized:

plugin-maven/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
44

55
## [Unreleased]
66

7+
* Add support for biome. The Rome project [was renamed to Biome](https://biomejs.dev/blog/annoucing-biome/).
8+
The configuration is still the same, but you should switch to the new `<biome>` tag and adjust
9+
the version accordingly. ([#1804](https://github.com/diffplug/spotless/issues/1804)).
10+
711
### Fixed
812
* Added support for plugins when using Prettier version `3.0.0` and newer. ([#1802](https://github.com/diffplug/spotless/pull/1802))
913

0 commit comments

Comments
 (0)