chore: expose schema generation function#8093
Conversation
|
WalkthroughAdded Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
🔇 Additional comments (1)
Comment |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
7588540 to
df7bf47
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
xtask/codegen/src/generate_schema.rs (1)
9-19: Consider adding documentation for this public API.Since
generate_schema()is being exposed for use by the website, it would benefit from a doc comment explaining its purpose, return value, and potential errors.Example:
+/// Generates a JSON schema for Biome's configuration. +/// +/// Returns the schema as a formatted JSON string. +/// +/// # Errors +/// +/// Returns an error if schema serialization or formatting fails. pub fn generate_schema() -> Result<String> {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
xtask/codegen/src/generate_schema.rs(1 hunks)xtask/codegen/src/lib.rs(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- xtask/codegen/src/lib.rs
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
xtask/codegen/src/generate_schema.rs
🧬 Code graph analysis (1)
xtask/codegen/src/generate_schema.rs (3)
xtask/codegen/src/lib.rs (1)
update(61-81)crates/biome_json_parser/src/lib.rs (1)
parse_json(26-29)xtask/src/lib.rs (1)
project_root(22-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Parser conformance
- GitHub Check: autofix
🔇 Additional comments (1)
xtask/codegen/src/generate_schema.rs (1)
1-1: Clean refactoring that achieves the stated objective.The extraction of
generate_schema()into a reusable function is well done. The import change is correct, and the updatedgenerate_configuration_schema()properly delegates to the new function whilst maintaining existing behaviour.Also applies to: 21-29
CodSpeed Performance ReportMerging #8093 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (32)
Cargo.toml(1 hunks)xtask/codegen/Cargo.toml(1 hunks)xtask/codegen/src/ast.rs(1 hunks)xtask/codegen/src/formatter.rs(4 hunks)xtask/codegen/src/generate_analyzer.rs(8 hunks)xtask/codegen/src/generate_analyzer_rule_options.rs(1 hunks)xtask/codegen/src/generate_bindings.rs(1 hunks)xtask/codegen/src/generate_configuration.rs(4 hunks)xtask/codegen/src/generate_grit_mappings.rs(2 hunks)xtask/codegen/src/generate_license.rs(2 hunks)xtask/codegen/src/generate_macros.rs(1 hunks)xtask/codegen/src/generate_migrate_eslint.rs(2 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(1 hunks)xtask/codegen/src/generate_node_factory.rs(2 hunks)xtask/codegen/src/generate_nodes.rs(2 hunks)xtask/codegen/src/generate_nodes_mut.rs(2 hunks)xtask/codegen/src/generate_schema.rs(1 hunks)xtask/codegen/src/generate_syntax_factory.rs(2 hunks)xtask/codegen/src/generate_syntax_kinds.rs(1 hunks)xtask/codegen/src/generate_target_language_constants.rs(2 hunks)xtask/codegen/src/lib.rs(2 hunks)xtask/codegen/src/main.rs(4 hunks)xtask/codegen/src/unicode.rs(2 hunks)xtask/coverage/Cargo.toml(1 hunks)xtask/coverage/src/compare.rs(1 hunks)xtask/coverage/src/js/test262.rs(1 hunks)xtask/coverage/src/jsx/jsx_babel.rs(1 hunks)xtask/coverage/src/main.rs(2 hunks)xtask/coverage/src/symbols/msts.rs(1 hunks)xtask/coverage/src/ts/ts_babel.rs(1 hunks)xtask/coverage/src/ts/ts_microsoft.rs(1 hunks)xtask/glue/Cargo.toml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- xtask/codegen/src/lib.rs
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
xtask/codegen/src/generate_schema.rs
🧬 Code graph analysis (26)
xtask/codegen/src/generate_macros.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/codegen/src/ast.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_license.rs (1)
xtask/glue/src/lib.rs (2)
project_root(22-30)reformat(43-45)
xtask/codegen/src/generate_syntax_kinds.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/codegen/src/generate_configuration.rs (2)
xtask/codegen/src/lib.rs (1)
update(58-78)xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/coverage/src/ts/ts_babel.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_bindings.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/unicode.rs (1)
xtask/glue/src/lib.rs (2)
reformat(43-45)project_root(22-30)
xtask/codegen/src/generate_new_analyzer_rule.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_syntax_factory.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/codegen/src/generate_target_language_constants.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/coverage/src/compare.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_nodes_mut.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/codegen/src/main.rs (3)
xtask/glue/src/lib.rs (1)
project_root(22-30)xtask/glue/src/glue.rs (2)
pushd(75-78)pushd(190-194)xtask/codegen/src/generate_schema.rs (1)
generate_configuration_schema(23-31)
xtask/codegen/src/generate_nodes.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/codegen/src/formatter.rs (1)
xtask/glue/src/lib.rs (3)
project_root(22-30)reformat_with_command(47-51)reformat_without_preamble(58-67)
xtask/coverage/src/js/test262.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/coverage/src/main.rs (2)
xtask/glue/src/lib.rs (1)
project_root(22-30)xtask/glue/src/glue.rs (2)
pushd(75-78)pushd(190-194)
xtask/codegen/src/generate_schema.rs (3)
xtask/codegen/src/lib.rs (1)
update(58-78)crates/biome_json_parser/src/lib.rs (1)
parse_json(26-29)xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/coverage/src/ts/ts_microsoft.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_node_factory.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/codegen/src/generate_analyzer.rs (1)
xtask/glue/src/lib.rs (2)
project_root(22-30)reformat(43-45)
xtask/coverage/src/symbols/msts.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_migrate_eslint.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
xtask/coverage/src/jsx/jsx_babel.rs (1)
xtask/glue/src/lib.rs (1)
project_root(22-30)
xtask/codegen/src/generate_grit_mappings.rs (1)
xtask/glue/src/lib.rs (1)
reformat(43-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: autofix
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Parser conformance
- GitHub Check: Bench (biome_css_parser)
🔇 Additional comments (32)
xtask/codegen/src/generate_new_analyzer_rule.rs (1)
4-4: LGTM! Import path updated correctly.The refactoring from
xtasktoxtask_glueis properly applied here.xtask/codegen/src/unicode.rs (2)
60-60: LGTM! Clean refactor to xtask_glue.The switch from
xtask::reformattoxtask_glue::reformatis correct and maintains the same behaviour.
62-62: LGTM! Consistent migration to xtask_glue.Both occurrences of
project_root()have been correctly updated to usextask_glue. The function signature matches the usage pattern.Also applies to: 84-84
xtask/codegen/src/generate_syntax_kinds.rs (1)
308-308: LGTM—consistent with the crate rename.The refactoring from
xtask::reformattoxtask_glue::reformatis correct.xtask/coverage/src/symbols/msts.rs (1)
15-15: LGTM—import path updated correctly.The change from
xtask::project_roottoxtask_glue::project_rootaligns with the crate rename.xtask/codegen/src/generate_macros.rs (1)
67-67: LGTM—refactoring applied consistently.xtask/glue/Cargo.toml (1)
3-3: LGTM—package renamed correctly.This is the source of the crate rename that cascades to all import paths across the codebase.
xtask/codegen/src/generate_target_language_constants.rs (1)
6-6: LGTM—imports and usage updated consistently.Both the
Resulttype import and thereformatfunction call have been updated to usextask_glue.Also applies to: 57-57
xtask/coverage/src/ts/ts_babel.rs (1)
12-12: LGTM—import updated correctly.xtask/codegen/src/generate_license.rs (1)
7-8: LGTM—all xtask references migrated correctly.The wildcard import, specific imports, and function call have all been updated to use
xtask_glue.Also applies to: 44-44
xtask/coverage/Cargo.toml (1)
3-3: LGTM—manifest updated correctly.The package name has been updated to
xtask_coverage, and the dependency has been changed fromxtasktoxtask_glue, aligning with the crate rename.Also applies to: 29-29
xtask/coverage/src/ts/ts_microsoft.rs (1)
17-17: LGTM – Import path updated correctly.The import correctly references the renamed crate.
xtask/coverage/src/js/test262.rs (1)
13-13: LGTM – Import path updated correctly.Consistent with the crate rename to
xtask_glue.xtask/codegen/src/generate_syntax_factory.rs (1)
7-7: LGTM – Crate paths updated correctly.Both the
Resultimport andreformatcall now correctly referencextask_glue.Also applies to: 175-175
xtask/codegen/src/generate_nodes_mut.rs (1)
4-4: LGTM – Crate references updated.The
Resulttype andreformatfunction now correctly usextask_glue.Also applies to: 91-91
xtask/codegen/src/generate_migrate_eslint.rs (1)
10-10: LGTM – Module paths updated.Both the wildcard import and the
reformatcall correctly referencextask_glue.Also applies to: 51-51
xtask/codegen/src/generate_analyzer.rs (1)
6-6: LGTM – Comprehensive crate migration.All imports and function calls have been correctly updated to use
xtask_gluethroughout the analyzer generation code.Also applies to: 121-121, 196-196, 223-223, 242-242, 262-262, 282-282, 301-301
xtask/codegen/src/formatter.rs (1)
14-14: LGTM – Formatter utilities migrated.All references to
project_root,reformat_with_command, andreformat_without_preamblenow correctly usextask_glue.Also applies to: 218-218, 456-458, 551-551
xtask/codegen/src/generate_bindings.rs (1)
15-15: LGTM – Import updated correctly.The import now correctly references
xtask_glueforMode,Result, andproject_root.xtask/coverage/src/main.rs (2)
2-2: LGTM! Import path updated consistently.The migration to
xtask_gluealigns with the broader refactoring across the codebase.
45-55: Nice documentation improvement.The expanded help text clarifies the valid suite values and documents the default behaviour, making the tool more user-friendly.
xtask/codegen/src/generate_node_factory.rs (1)
6-6: LGTM! Consistent migration to xtask_glue.The import and function call updates are straightforward refactoring with no functional changes.
Also applies to: 217-217
xtask/codegen/src/generate_nodes.rs (1)
7-7: LGTM! Import path updates aligned with codebase migration.Consistent with the broader refactoring to use
xtask_glue.Also applies to: 992-992
xtask/codegen/src/generate_configuration.rs (2)
17-17: LGTM! Wildcard import simplifies usage.The
use xtask_glue::*;brings in all needed utilities consistently.
281-281: LGTM! All reformat call sites updated consistently.Multiple invocations of
xtask_glue::reformatensure uniform formatting across the generated configuration code.Also applies to: 833-834, 1233-1233
xtask/codegen/src/generate_grit_mappings.rs (1)
2-2: LGTM! Consistent with the migration pattern.Import and reformat call updated to use
xtask_glue.Also applies to: 130-130
xtask/codegen/src/generate_schema.rs (2)
9-20: Well-structured API extraction!The new
generate_schema_as_string()function cleanly separates schema generation logic from file I/O, making it reusable by the website. The formatting chain (build → serialise → parse → format → code) is correct.
22-31: Good separation of concerns.
generate_configuration_schema()now delegates togenerate_schema_as_string()and handles only file writing. The visibility change topubaligns with the PR objective to expose this for external use. Error propagation using?is clean.xtask/codegen/src/main.rs (1)
10-10: LGTM! Consistent import updates.Migration to
xtask_gluefor utilities andModetype is consistent with the broader refactoring.Also applies to: 29-29
xtask/codegen/Cargo.toml (3)
16-16: LGTM! Dependency updated for glue crate migration.The switch from
xtasktoxtask_glue(workspace dependency) is consistent with the broader refactoring.
18-44: Dependencies added to support schema generation.The additional
biome_*crates (particularlybiome_json_formatter,biome_json_parser,biome_configuration) are required for the newgenerate_schema_as_string()function and are properly gated by feature flags.
46-77: Feature gates properly configured.The
schemafeature correctly includes all dependencies needed for schema generation (schemars,serde_json,biome_json_formatter,biome_json_parser, etc.).
Summary
The codegen is currently broken because we updated the
schemarspackage.This PR exposes a new public function,
generate_schema, so we can use it on the website instead of repeating code.Less maintenance work.
Test Plan
CI should stay green
Docs