Skip to content

refactor(conf): opt-in bpaf#9920

Merged
ematipico merged 2 commits intomainfrom
refactor/cli-configuration
Apr 11, 2026
Merged

refactor(conf): opt-in bpaf#9920
ematipico merged 2 commits intomainfrom
refactor/cli-configuration

Conversation

@ematipico
Copy link
Copy Markdown
Member

Summary

This PR makes bpaf a feature of biome_configuration

Written with Ai

Test Plan

Green ci

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 11, 2026

⚠️ No Changeset found

Latest commit: ec6db54

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project labels Apr 11, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 11, 2026

Merging this PR will not alter performance

✅ 1 untouched benchmark
⏩ 255 skipped benchmarks1


Comparing refactor/cli-configuration (ec6db54) with main (4d9ac51)

Open in CodSpeed

Footnotes

  1. 255 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Walkthrough

The PR makes CLI parsing optional in the biome_configuration crate by adding a new cli Cargo feature and marking the bpaf dependency optional. Many configuration modules and exported types now import bpaf::Bpaf, derive Bpaf, and apply #[bpaf(...)] attributes only when feature = "cli" is enabled via #[cfg(feature = "cli")]/#[cfg_attr(...)]. The biome_cli crate enables the cli feature on its biome_configuration dependency. Public struct fields, types, serde/schema behavior and non‑CLI logic are unchanged.

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring: making bpaf an opt-in feature of biome_configuration through conditional compilation.
Description check ✅ Passed The description explains the core change (making bpaf a feature), includes an AI disclosure, and mentions a test plan, though it could be more detailed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/cli-configuration

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
crates/biome_configuration/src/lib.rs (1)

26-85: Please add or point to a cli feature smoke test.

This introduces a new supported compile surface, but I can’t see matching coverage in the reviewed changes. A quick cargo check for biome_configuration with and without cli would catch stray bpaf imports and attrs before they sneak back in. Happy to help wire that up if useful.

As per coding guidelines **/*.{rs,ts,tsx,js}: All code changes MUST include appropriate tests.

Also applies to: 123-215, 438-439, 576-603

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_configuration/src/lib.rs` around lines 26 - 85, Add a smoke test
that compiles the biome_configuration crate both with and without the "cli"
feature to catch stray bpaf imports and misplaced cfg attributes: create a new
integration test (e.g. tests/cli_feature_smoke.rs) that runs cargo check (or
uses Command to invoke cargo) twice — once with --no-default-features and once
with --features cli — and assert both succeed; ensure this test is part of the
crate's tests so CI runs it, and verify the code paths that reference bpaf,
bpaf::Bpaf, and any cfg(feature = "cli")-guarded items (e.g., the bpaf import
lines and pub use xyz under cfg(feature = "cli")) are correctly gated so the
no-feature build passes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@crates/biome_configuration/src/lib.rs`:
- Around line 26-85: Add a smoke test that compiles the biome_configuration
crate both with and without the "cli" feature to catch stray bpaf imports and
misplaced cfg attributes: create a new integration test (e.g.
tests/cli_feature_smoke.rs) that runs cargo check (or uses Command to invoke
cargo) twice — once with --no-default-features and once with --features cli —
and assert both succeed; ensure this test is part of the crate's tests so CI
runs it, and verify the code paths that reference bpaf, bpaf::Bpaf, and any
cfg(feature = "cli")-guarded items (e.g., the bpaf import lines and pub use xyz
under cfg(feature = "cli")) are correctly gated so the no-feature build passes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c33ef8f2-c290-4016-9f18-f599cc2e29aa

📥 Commits

Reviewing files that changed from the base of the PR and between bf40a0c and 9503565.

📒 Files selected for processing (17)
  • crates/biome_cli/Cargo.toml
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/mod.rs
  • crates/biome_configuration/src/analyzer/linter/mod.rs
  • crates/biome_configuration/src/css.rs
  • crates/biome_configuration/src/formatter.rs
  • crates/biome_configuration/src/graphql.rs
  • crates/biome_configuration/src/grit.rs
  • crates/biome_configuration/src/html.rs
  • crates/biome_configuration/src/javascript/formatter.rs
  • crates/biome_configuration/src/javascript/mod.rs
  • crates/biome_configuration/src/json.rs
  • crates/biome_configuration/src/lib.rs
  • crates/biome_configuration/src/markdown.rs
  • crates/biome_configuration/src/organize_imports.rs
  • crates/biome_configuration/src/overrides.rs
  • crates/biome_configuration/src/vcs.rs

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
crates/biome_configuration/src/lib.rs (1)

122-223: Consider adding explicit feature-matrix coverage documentation for biome_configuration.

The crate already gets tested without the cli feature (implicitly, via default = [] in Cargo.toml), so the non-CLI build path is covered by existing tests in tests/spec_tests.rs. However, there's no explicit, documented test target that validates this. Consider adding to justfile or CI:

cargo test -p biome_configuration --no-default-features

This makes it clear for future maintainers that the crate is tested in both configurations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_configuration/src/lib.rs` around lines 122 - 223, Tests
currently don't explicitly assert the non-CLI build of biome_configuration; add
a CI/justfile job that runs the crate's test suite with no default features to
ensure coverage. Update the project automation (e.g., justfile and CI workflow)
to include a command that runs "cargo test -p biome_configuration
--no-default-features" (or equivalent) and ensure it runs the tests in
tests/spec_tests.rs for the crate; name the job/target clearly (e.g.,
"test:biome_configuration:no-default-features") so maintainers can see the
feature-matrix coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@crates/biome_configuration/src/lib.rs`:
- Around line 122-223: Tests currently don't explicitly assert the non-CLI build
of biome_configuration; add a CI/justfile job that runs the crate's test suite
with no default features to ensure coverage. Update the project automation
(e.g., justfile and CI workflow) to include a command that runs "cargo test -p
biome_configuration --no-default-features" (or equivalent) and ensure it runs
the tests in tests/spec_tests.rs for the crate; name the job/target clearly
(e.g., "test:biome_configuration:no-default-features") so maintainers can see
the feature-matrix coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e4c54f37-a15f-4c8a-bda7-7385e433fc04

📥 Commits

Reviewing files that changed from the base of the PR and between 9503565 and ec6db54.

📒 Files selected for processing (15)
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/mod.rs
  • crates/biome_configuration/src/analyzer/linter/mod.rs
  • crates/biome_configuration/src/css.rs
  • crates/biome_configuration/src/formatter.rs
  • crates/biome_configuration/src/graphql.rs
  • crates/biome_configuration/src/grit.rs
  • crates/biome_configuration/src/html.rs
  • crates/biome_configuration/src/javascript/formatter.rs
  • crates/biome_configuration/src/javascript/mod.rs
  • crates/biome_configuration/src/json.rs
  • crates/biome_configuration/src/lib.rs
  • crates/biome_configuration/src/markdown.rs
  • crates/biome_configuration/src/overrides.rs
  • crates/biome_configuration/src/vcs.rs
🚧 Files skipped from review as they are similar to previous changes (10)
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/formatter.rs
  • crates/biome_configuration/src/analyzer/assist/mod.rs
  • crates/biome_configuration/src/grit.rs
  • crates/biome_configuration/src/graphql.rs
  • crates/biome_configuration/src/analyzer/linter/mod.rs
  • crates/biome_configuration/src/markdown.rs
  • crates/biome_configuration/src/javascript/mod.rs
  • crates/biome_configuration/src/html.rs
  • crates/biome_configuration/src/css.rs

Copy link
Copy Markdown
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Looks fine, but what's the goal?

@ematipico
Copy link
Copy Markdown
Member Author

Looks fine, but what's the goal?

Avoiding pulling crates that aren't needed, so less things to compile e.g. benchmarks

@ematipico ematipico merged commit 80c5c00 into main Apr 11, 2026
15 checks passed
@ematipico ematipico deleted the refactor/cli-configuration branch April 11, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants