Skip to content
Merged
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
18 changes: 9 additions & 9 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ codegen = "run -p xtask_codegen --"
codegen-bindings = "run -p xtask_codegen --features schema -- bindings"
codegen-configuration = "run -p xtask_codegen --features configuration -- configuration"
# updates a newly created crate
codegen-license = "run -p xtask_codegen --features license -- license"
codegen-migrate = "run -p xtask_codegen --features configuration -- migrate-eslint"
codegen-schema = "run -p xtask_codegen --features schema -- schema"
contributors = "run -p xtask_contributors --"
coverage = "run -p xtask_coverage --profile=release-with-debug --"
documentation = """
codegen-license = "run -p xtask_codegen --features license -- license"
codegen-migrate = "run -p xtask_codegen --features configuration -- migrate-eslint"
codegen-schema = "run -p xtask_codegen --features schema -- schema"
contributors = "run -p xtask_contributors --"
coverage = "run -p xtask_coverage --profile=release-with-debug --"
documentation = """
doc \
-p biome_*formatter \
-p biome_control_flow \
Expand All @@ -32,9 +32,9 @@ documentation = """
-p biome_configuration \
--no-deps
"""
format = "fmt --all --verbose"
lint = "clippy --workspace --all-features --all-targets -- --deny warnings"
new-crate = "run -p xtask_codegen -- new-crate"
format = "fmt --all --verbose"
lint = "clippy --workspace --all-features --all-targets -- --deny warnings"
new-crate = "run -p xtask_codegen -- new-crate"

[profile.release]
lto = true
4 changes: 3 additions & 1 deletion .github/renovate.json → .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
"grit-pattern-matcher",
"grit-util",
"getrandom",
"rand"
"rand",
// Needs to be updated manually
"wasm-bindgen-cli"
Comment on lines +46 to +48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

The wasm-bindgen-cli ignore is appropriate—consider documenting the version sync requirement.

wasm-bindgen-cli's bindgen format is unstable enough that its version must exactly match the wasm-bindgen library dependency, making manual updates necessary. Since Biome's build process depends on WebAssembly bindings, this change correctly prevents Renovate from auto-updating a package that could break the build if misaligned.

If this fix is tangential to your PR's primary objective (Taplo → Tombi migration), consider whether it belongs in a separate PR for clearer review scope. Otherwise, the comment could reference why version sync matters for future maintainers.

🤖 Prompt for AI Agents
.github/renovate.json5 lines 46-48: the current Renovate ignore for
"wasm-bindgen-cli" is fine but lacks documentation; add a brief comment in the
file explaining that wasm-bindgen-cli must be manually updated because its
version must exactly match the wasm-bindgen library to avoid breaking
WebAssembly bindings, and note that this change may be split into a separate PR
if it’s unrelated to the Taplo→Tombi migration to keep scope clear.

]
},
{
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2
with:
components: rustfmt
bins: taplo-cli
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -52,6 +51,11 @@ jobs:
- name: Run format
run: |
cargo fmt --all
taplo format

- uses: tombi-toml/setup-tombi@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Format TOML files
run: tombi format

- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ jobs:
uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2
with:
components: rustfmt
bins: taplo-cli
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run rustfmt
run: |
cargo fmt --all --verbose -- --check
taplo format --check
- uses: tombi-toml/setup-tombi@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Format TOML files
run: tombi format --check
Comment on lines +38 to +42
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find . -name "main.yml" -path "*/.github/workflows/*" | head -20

Repository: biomejs/biome

Length of output: 85


🏁 Script executed:

cat .github/workflows/main.yml | head -100

Repository: biomejs/biome

Length of output: 3151


🏁 Script executed:

grep -n "uses:" .github/workflows/main.yml

Repository: biomejs/biome

Length of output: 1040


Pin the action to a specific commit hash for consistency and supply chain security.

Third-party actions should be pinned to specific commit hash SHAs for maximum control and immutability. Other actions in this workflow use commit hash pinning (e.g., actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8), but tombi-toml/setup-tombi uses @v1. Version tags can be moved or deleted if a bad actor gains access to the repository storing the action—commit hashes prevent this.

🤖 Prompt for AI Agents
In .github/workflows/main.yml around lines 38 to 42, the tombi-toml/setup-tombi
action is pinned to a mutable tag (@v1); replace that tag with a specific commit
SHA from the tombi-toml/setup-tombi repository (e.g., @<commit-sha>) to ensure
immutability and supply-chain security — locate the desired release commit on
the action repo, copy its full commit hash, and update the workflow step to use
that SHA while leaving the env and run lines unchanged.


lint:
name: Lint Rust Files
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ just install-tools
This command will install:
- `cargo-binstall`, to install binary extensions for `cargo`.
- `cargo-insta`, a `cargo` extension to manage snapshot testing inside the repository.
- `taplo-cli`, a small tool for formatting TOML files.
- `tombi`, a small tool for formatting TOML files.
- `wasm-bindgen-cli` and `wasm-opt` for managing the WASM build of Biome.

You'll also need to have `pnpm` installed on your machine, and run `pnpm install` from the root of the repository. `pnpm` is needed to [create changesets](#create-a-changeset)
Expand Down
490 changes: 242 additions & 248 deletions Cargo.toml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
allow-dbg-in-tests = true

disallowed-methods = [
{ path = "str::to_ascii_lowercase", reason = "Avoid memory allocation. Use `biome_string_case::StrOnlyExtension::to_ascii_lowercase_cow` instead." },
{ path = "std::ffi::OsStr::to_ascii_lowercase", reason = "Avoid memory allocation. Use `biome_string_case::StrLikeExtension::to_ascii_lowercase_cow` instead." },
Expand Down
16 changes: 8 additions & 8 deletions crates/biome_analyze/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "biome_analyze"
version = "0.5.7"
authors.workspace = true
categories.workspace = true
description = "Biome's analyzer shared infrastructure"
edition.workspace = true
description = "Biome's analyzer shared infrastructure"
homepage.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
name = "biome_analyze"
keywords.workspace = true
categories.workspace = true
publish = true
repository.workspace = true
version = "0.5.7"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -29,8 +29,8 @@ schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"], optional = true }

[features]
schema = ["dep:schemars", "biome_console/schema", "serde"]
serde = ["dep:serde", "dep:biome_deserialize", "dep:biome_deserialize_macros"]
schema = ["biome_console/schema", "dep:schemars", "serde"]
serde = ["dep:biome_deserialize", "dep:biome_deserialize_macros", "dep:serde"]

[lints]
workspace = true
12 changes: 6 additions & 6 deletions crates/biome_aria/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "biome_aria"
version = "0.5.7"
authors.workspace = true
categories.workspace = true
description = "Utilities to create ARIA query for biome_js_analyze"
edition.workspace = true
description = "Utilities to create ARIA query for biome_js_analyze"
homepage.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
name = "biome_aria"
keywords.workspace = true
categories.workspace = true
publish = true
repository.workspace = true
version = "0.5.7"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
13 changes: 6 additions & 7 deletions crates/biome_aria_metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
[package]
name = "biome_aria_metadata"
version = "0.5.7"
authors.workspace = true
categories.workspace = true
description = "Metadata about ARIA properties and ARIA roles"
edition.workspace = true
description = "Metadata about ARIA properties and ARIA roles"
homepage.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
name = "biome_aria_metadata"
keywords.workspace = true
categories.workspace = true
publish = true
repository.workspace = true
version = "0.5.7"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]


[build-dependencies]
biome_deserialize = { workspace = true }
biome_deserialize_macros = { workspace = true }
Expand Down
46 changes: 27 additions & 19 deletions crates/biome_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "biome_cli"
version = "0.0.0"
authors.workspace = true
categories.workspace = true
description = "Biome's command line interface"
edition.workspace = true
description = "Biome's command line interface"
homepage.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
name = "biome_cli"
keywords.workspace = true
categories.workspace = true
publish = false
repository.workspace = true
version = "0.0.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -26,7 +26,7 @@ biome_css_analyze = { workspace = true }
biome_css_syntax = { workspace = true }
biome_deserialize = { workspace = true }
biome_deserialize_macros = { workspace = true }
biome_diagnostics = { workspace = true, features = ["std", "bpaf"] }
biome_diagnostics = { workspace = true, features = ["bpaf", "std"] }
biome_flags = { workspace = true }
biome_formatter = { workspace = true }
biome_fs = { workspace = true }
Expand Down Expand Up @@ -63,23 +63,21 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
smallvec = { workspace = true }
terminal_size = { workspace = true }
tokio = { workspace = true, features = ["io-std", "io-util", "net", "time", "rt", "sync", "rt-multi-thread", "macros"] }
tokio = { workspace = true, features = [
"io-std",
"io-util",
"macros",
"net",
"rt",
"rt-multi-thread",
"sync",
"time"
] }
tracing = { workspace = true }
tracing-appender = "0.2.3"
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }
tracing-tree = "0.4.1"


[target.'cfg(unix)'.dependencies]
libc = "0.2.177"
tokio = { workspace = true, features = ["process"] }

[target.'cfg(windows)'.dependencies]
mimalloc = { workspace = true }

[target.'cfg(all(target_family="unix", not(all(target_arch = "aarch64", target_env = "musl"))))'.dependencies]
tikv-jemallocator = { workspace = true }

[dev-dependencies]
biome_css_formatter = { workspace = true }
biome_js_formatter = { workspace = true }
Expand All @@ -89,6 +87,16 @@ insta = { workspace = true }
regex = { workspace = true }
tokio = { workspace = true, features = ["io-util"] }

[target.'cfg(all(target_family="unix", not(all(target_arch = "aarch64", target_env = "musl"))))'.dependencies]
tikv-jemallocator = { workspace = true }

[target.'cfg(unix)'.dependencies]
libc = "0.2.177"
tokio = { workspace = true, features = ["process"] }
Comment on lines +93 to +95
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n Cargo.toml | grep -A 50 "\[workspace.dependencies\]"

Repository: biomejs/biome

Length of output: 4617


🏁 Script executed:

rg -n 'libc' Cargo.toml

Repository: biomejs/biome

Length of output: 101


🏁 Script executed:

sed -n '100,135p' Cargo.toml | cat -n

Repository: biomejs/biome

Length of output: 2286


🏁 Script executed:

sed -n '16,130p' Cargo.toml | grep -E '^\[|^libc'

Repository: biomejs/biome

Length of output: 122


🏁 Script executed:

# Also check if libc appears elsewhere in crates/biome_cli/Cargo.toml with different versions
cat -n crates/biome_cli/Cargo.toml | grep -i libc

Repository: biomejs/biome

Length of output: 81


🏁 Script executed:

# Check how libc is used in other crates
fd 'Cargo.toml' crates/ -x grep -l 'libc' {} \;

Repository: biomejs/biome

Length of output: 122


🏁 Script executed:

# Check if other platform-specific dependencies use workspace = true
grep -n "target.*dependencies" crates/biome_cli/Cargo.toml -A 5

Repository: biomejs/biome

Length of output: 506


🏁 Script executed:

# Check how libc is specified in biome_plugin_loader
grep -n 'libc' crates/biome_plugin_loader/Cargo.toml -B 2 -A 2

Repository: biomejs/biome

Length of output: 345


🏁 Script executed:

# Verify the workspace guideline applies here - check if this is an internal-only dependency
grep -n 'libc' crates/*/Cargo.toml | head -20

Repository: biomejs/biome

Length of output: 314


Use workspace dependency for libc to match the pattern used in other crates.

libc is defined in root workspace dependencies as 0.2.178, but biome_cli pins it to 0.2.177 directly. Switch to { workspace = true } like biome_plugin_loader does in its platform-specific dependencies section.

🤖 Prompt for AI Agents
In crates/biome_cli/Cargo.toml around lines 93 to 95, the unix-target dependency
pins libc = "0.2.177" while the workspace declares libc = "0.2.178"; replace the
explicit version with the workspace reference by changing the libc entry to use
{ workspace = true } so the crate uses the workspace-managed libc version
(matching biome_plugin_loader's pattern) and avoid version drift.


[target.'cfg(windows)'.dependencies]
mimalloc = { workspace = true }

[features]
docgen = ["bpaf/docgen"]
js_plugin = ["biome_service/js_plugin"]
Expand Down
65 changes: 32 additions & 33 deletions crates/biome_configuration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
[package]
name = "biome_configuration"
version = "0.0.1"
authors.workspace = true
categories.workspace = true
description = "Biome Configuration"
edition.workspace = true
description = "Biome Configuration"
homepage.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
name = "biome_configuration"
keywords.workspace = true
categories.workspace = true
publish = false
repository.workspace = true
version = "0.0.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
biome_analyze = { workspace = true, features = ["serde"] }
biome_console = { workspace = true }
[package.metadata.cargo-udeps.ignore]
# currently technically not used, but needed in order to compile because of the `schema` feature
normal = ["biome_html_syntax"]

[[bench]]
harness = false
name = "biome_json"

[dependencies]
biome_analyze = { workspace = true, features = ["serde"] }
biome_console = { workspace = true }
biome_deserialize = { workspace = true }
biome_deserialize_macros = { workspace = true }
biome_diagnostics = { workspace = true }
Expand All @@ -40,38 +47,30 @@ rustc-hash = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }

[features]
schema = [
"dep:schemars",
"biome_formatter/schema",
"biome_json_syntax/schema",
"biome_html_formatter/schema",
"biome_html_syntax/schema",
"biome_analyze/schema",
"biome_json_formatter/schema",
"biome_js_formatter/schema",
"biome_rule_options/schema",
"biome_plugin_loader/schema",
]

[dev-dependencies]
criterion = { package = "codspeed-criterion-compat", version = "=3.0.5" }
insta = { workspace = true }
tests_macros = { workspace = true }
Comment on lines 50 to 53
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent dev-dependency pattern for internal crate.

tests_macros uses workspace = true here, whilst crates/biome_css_formatter/Cargo.toml uses { path = "../tests_macros" } for the same crate. As per coding guidelines, dev-dependencies for internal crates should use path dependencies to avoid requiring published versions.

🔎 Suggested fix
 [dev-dependencies]
 criterion    = { package = "codspeed-criterion-compat", version = "=3.0.5" }
 insta        = { workspace = true }
-tests_macros = { workspace = true }
+tests_macros = { path = "../tests_macros" }

Based on learnings: Use path dependencies for internal crates in dev-dependencies.

🤖 Prompt for AI Agents
In crates/biome_configuration/Cargo.toml around lines 50 to 53, the
dev-dependency for the internal crate tests_macros uses workspace = true which
is inconsistent with other crates; change it to a path dependency (e.g.,
tests_macros = { path = "../tests_macros" }) so the dev-dependency references
the local crate source instead of relying on workspace/published versions,
matching the pattern used in crates/biome_css_formatter.


[target.'cfg(all(target_family="unix", not(all(target_arch = "aarch64", target_env = "musl"))))'.dev-dependencies]
tikv-jemallocator = { workspace = true }

[target.'cfg(target_os = "windows")'.dev-dependencies]
mimalloc = { workspace = true }

[target.'cfg(all(target_family="unix", not(all(target_arch = "aarch64", target_env = "musl"))))'.dev-dependencies]
tikv-jemallocator = { workspace = true }
[features]
schema = [
"biome_analyze/schema",
"biome_formatter/schema",
"biome_html_formatter/schema",
"biome_html_syntax/schema",
"biome_js_formatter/schema",
"biome_json_formatter/schema",
"biome_json_syntax/schema",
"biome_plugin_loader/schema",
"biome_rule_options/schema",
"dep:schemars",
]

[lints]
workspace = true

[package.metadata.cargo-udeps.ignore]
# currently technically not used, but needed in order to compile because of the `schema` feature
normal = ["biome_html_syntax"]

[[bench]]
harness = false
name = "biome_json"
17 changes: 8 additions & 9 deletions crates/biome_console/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
[package]
name = "biome_console"
version = "0.5.7"
authors.workspace = true
categories.workspace = true
description = "Utilities to print messages (formatted with biome_markup) and diagnostics"
edition.workspace = true
description = "Utilities to print messages (formatted with biome_markup) and diagnostics"
homepage.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
name = "biome_console"
keywords.workspace = true
categories.workspace = true
publish = true
repository.workspace = true
version = "0.5.7"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
biome_markup = { workspace = true }
biome_text_size = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true, optional = true, features = ["derive"] }
serde = { workspace = true, features = ["derive"], optional = true }
termcolor = { workspace = true }
unicode-segmentation = "1.12.0"
unicode-width = { workspace = true }

[dev-dependencies]
trybuild = "=1.0.114"


[features]
schema = ["dep:schemars", "serde", "biome_text_size/schema"]
schema = ["biome_text_size/schema", "dep:schemars", "serde"]
serde = ["dep:serde"]

[lints]
Expand Down
Loading
Loading