diff --git a/crates/biome_css_analyze/src/assist.rs b/crates/biome_css_analyze/src/assist.rs index 6174b359db67..eda0eb9b2532 100644 --- a/crates/biome_css_analyze/src/assist.rs +++ b/crates/biome_css_analyze/src/assist.rs @@ -1,6 +1,4 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod source; ::biome_analyze::declare_category! { pub Assist { kind : Action , groups : [self :: source :: Source ,] } } diff --git a/crates/biome_css_analyze/src/assist/source.rs b/crates/biome_css_analyze/src/assist/source.rs index eb2410e3ccaa..f0782dff3c86 100644 --- a/crates/biome_css_analyze/src/assist/source.rs +++ b/crates/biome_css_analyze/src/assist/source.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/lint.rs b/crates/biome_css_analyze/src/lint.rs index 45b032101c60..dc60aac7070c 100644 --- a/crates/biome_css_analyze/src/lint.rs +++ b/crates/biome_css_analyze/src/lint.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod a11y; pub mod complexity; pub mod correctness; diff --git a/crates/biome_css_analyze/src/lint/a11y.rs b/crates/biome_css_analyze/src/lint/a11y.rs index 5c815edea19f..ab364ac9576a 100644 --- a/crates/biome_css_analyze/src/lint/a11y.rs +++ b/crates/biome_css_analyze/src/lint/a11y.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/lint/complexity.rs b/crates/biome_css_analyze/src/lint/complexity.rs index de9acc44aea4..c8e439ac970f 100644 --- a/crates/biome_css_analyze/src/lint/complexity.rs +++ b/crates/biome_css_analyze/src/lint/complexity.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/lint/correctness.rs b/crates/biome_css_analyze/src/lint/correctness.rs index 4f73c452b3c5..35d8f3a9ff2a 100644 --- a/crates/biome_css_analyze/src/lint/correctness.rs +++ b/crates/biome_css_analyze/src/lint/correctness.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/lint/nursery.rs b/crates/biome_css_analyze/src/lint/nursery.rs index 43d1a4f1a4e7..5b920c140e7f 100644 --- a/crates/biome_css_analyze/src/lint/nursery.rs +++ b/crates/biome_css_analyze/src/lint/nursery.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/lint/style.rs b/crates/biome_css_analyze/src/lint/style.rs index c9e6240fa3c5..d57376b64082 100644 --- a/crates/biome_css_analyze/src/lint/style.rs +++ b/crates/biome_css_analyze/src/lint/style.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/lint/suspicious.rs b/crates/biome_css_analyze/src/lint/suspicious.rs index 9c4e7a565abd..444958b451a9 100644 --- a/crates/biome_css_analyze/src/lint/suspicious.rs +++ b/crates/biome_css_analyze/src/lint/suspicious.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_css_analyze/src/registry.rs b/crates/biome_css_analyze/src/registry.rs index 26b12e197b1f..efc18b8641cf 100644 --- a/crates/biome_css_analyze/src/registry.rs +++ b/crates/biome_css_analyze/src/registry.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - use biome_analyze::RegistryVisitor; use biome_css_syntax::CssLanguage; pub fn visit_registry>(registry: &mut V) { diff --git a/crates/biome_graphql_analyze/src/lint.rs b/crates/biome_graphql_analyze/src/lint.rs index a158f72057e0..e90d61aa8a5f 100644 --- a/crates/biome_graphql_analyze/src/lint.rs +++ b/crates/biome_graphql_analyze/src/lint.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod correctness; pub mod nursery; pub mod style; diff --git a/crates/biome_graphql_analyze/src/lint/correctness.rs b/crates/biome_graphql_analyze/src/lint/correctness.rs index 4f73c452b3c5..35d8f3a9ff2a 100644 --- a/crates/biome_graphql_analyze/src/lint/correctness.rs +++ b/crates/biome_graphql_analyze/src/lint/correctness.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_graphql_analyze/src/lint/nursery.rs b/crates/biome_graphql_analyze/src/lint/nursery.rs index 43d1a4f1a4e7..5b920c140e7f 100644 --- a/crates/biome_graphql_analyze/src/lint/nursery.rs +++ b/crates/biome_graphql_analyze/src/lint/nursery.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_graphql_analyze/src/lint/style.rs b/crates/biome_graphql_analyze/src/lint/style.rs index c9e6240fa3c5..d57376b64082 100644 --- a/crates/biome_graphql_analyze/src/lint/style.rs +++ b/crates/biome_graphql_analyze/src/lint/style.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_graphql_analyze/src/lint/suspicious.rs b/crates/biome_graphql_analyze/src/lint/suspicious.rs index 9c4e7a565abd..444958b451a9 100644 --- a/crates/biome_graphql_analyze/src/lint/suspicious.rs +++ b/crates/biome_graphql_analyze/src/lint/suspicious.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_html_analyze/src/lint.rs b/crates/biome_html_analyze/src/lint.rs index 6f81f6ae6f99..f68ad5ff28d8 100644 --- a/crates/biome_html_analyze/src/lint.rs +++ b/crates/biome_html_analyze/src/lint.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod a11y; pub mod nursery; ::biome_analyze::declare_category! { pub Lint { kind : Lint , groups : [self :: a11y :: A11y , self :: nursery :: Nursery ,] } } diff --git a/crates/biome_html_analyze/src/lint/a11y.rs b/crates/biome_html_analyze/src/lint/a11y.rs index 5c815edea19f..ab364ac9576a 100644 --- a/crates/biome_html_analyze/src/lint/a11y.rs +++ b/crates/biome_html_analyze/src/lint/a11y.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_html_analyze/src/lint/nursery.rs b/crates/biome_html_analyze/src/lint/nursery.rs index 43d1a4f1a4e7..5b920c140e7f 100644 --- a/crates/biome_html_analyze/src/lint/nursery.rs +++ b/crates/biome_html_analyze/src/lint/nursery.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_html_analyze/src/options.rs b/crates/biome_html_analyze/src/options.rs index d4e16dd07977..3547118909a2 100644 --- a/crates/biome_html_analyze/src/options.rs +++ b/crates/biome_html_analyze/src/options.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - use crate::lint; pub type NoHeaderScope = ::Options; diff --git a/crates/biome_js_analyze/src/assist.rs b/crates/biome_js_analyze/src/assist.rs index 6174b359db67..eda0eb9b2532 100644 --- a/crates/biome_js_analyze/src/assist.rs +++ b/crates/biome_js_analyze/src/assist.rs @@ -1,6 +1,4 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod source; ::biome_analyze::declare_category! { pub Assist { kind : Action , groups : [self :: source :: Source ,] } } diff --git a/crates/biome_js_analyze/src/assist/source.rs b/crates/biome_js_analyze/src/assist/source.rs index eb2410e3ccaa..f0782dff3c86 100644 --- a/crates/biome_js_analyze/src/assist/source.rs +++ b/crates/biome_js_analyze/src/assist/source.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/assists.rs b/crates/biome_js_analyze/src/assists.rs index 64dd24c3e483..5d86871448da 100644 --- a/crates/biome_js_analyze/src/assists.rs +++ b/crates/biome_js_analyze/src/assists.rs @@ -1,6 +1,4 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod source; ::biome_analyze::declare_category! { pub Assists { kind : Action , groups : [self :: source :: Source ,] } } diff --git a/crates/biome_js_analyze/src/lint.rs b/crates/biome_js_analyze/src/lint.rs index c6c99e3c5795..ac79dce828e6 100644 --- a/crates/biome_js_analyze/src/lint.rs +++ b/crates/biome_js_analyze/src/lint.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod a11y; pub mod complexity; pub mod correctness; diff --git a/crates/biome_js_analyze/src/lint/a11y.rs b/crates/biome_js_analyze/src/lint/a11y.rs index 5c815edea19f..ab364ac9576a 100644 --- a/crates/biome_js_analyze/src/lint/a11y.rs +++ b/crates/biome_js_analyze/src/lint/a11y.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/complexity.rs b/crates/biome_js_analyze/src/lint/complexity.rs index de9acc44aea4..c8e439ac970f 100644 --- a/crates/biome_js_analyze/src/lint/complexity.rs +++ b/crates/biome_js_analyze/src/lint/complexity.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/correctness.rs b/crates/biome_js_analyze/src/lint/correctness.rs index 4f73c452b3c5..35d8f3a9ff2a 100644 --- a/crates/biome_js_analyze/src/lint/correctness.rs +++ b/crates/biome_js_analyze/src/lint/correctness.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/nursery.rs b/crates/biome_js_analyze/src/lint/nursery.rs index 43d1a4f1a4e7..5b920c140e7f 100644 --- a/crates/biome_js_analyze/src/lint/nursery.rs +++ b/crates/biome_js_analyze/src/lint/nursery.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/performance.rs b/crates/biome_js_analyze/src/lint/performance.rs index 6d93d2a0483d..fb83666d65fe 100644 --- a/crates/biome_js_analyze/src/lint/performance.rs +++ b/crates/biome_js_analyze/src/lint/performance.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/security.rs b/crates/biome_js_analyze/src/lint/security.rs index ce5fb77fb125..dfdd6c028956 100644 --- a/crates/biome_js_analyze/src/lint/security.rs +++ b/crates/biome_js_analyze/src/lint/security.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/style.rs b/crates/biome_js_analyze/src/lint/style.rs index c9e6240fa3c5..d57376b64082 100644 --- a/crates/biome_js_analyze/src/lint/style.rs +++ b/crates/biome_js_analyze/src/lint/style.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/lint/suspicious.rs b/crates/biome_js_analyze/src/lint/suspicious.rs index 9c4e7a565abd..444958b451a9 100644 --- a/crates/biome_js_analyze/src/lint/suspicious.rs +++ b/crates/biome_js_analyze/src/lint/suspicious.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_js_analyze/src/options.rs b/crates/biome_js_analyze/src/options.rs index 6c60db55b663..8f631e885d7f 100644 --- a/crates/biome_js_analyze/src/options.rs +++ b/crates/biome_js_analyze/src/options.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - use crate::assist; use crate::lint; pub type NoAccessKey = ::Options; diff --git a/crates/biome_js_analyze/src/syntax.rs b/crates/biome_js_analyze/src/syntax.rs index 2fae83396c8a..4364c7caaa04 100644 --- a/crates/biome_js_analyze/src/syntax.rs +++ b/crates/biome_js_analyze/src/syntax.rs @@ -1,6 +1,4 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod correctness; ::biome_analyze::declare_category! { pub Syntax { kind : Syntax , groups : [self :: correctness :: Correctness ,] } } diff --git a/crates/biome_js_analyze/src/syntax/correctness.rs b/crates/biome_js_analyze/src/syntax/correctness.rs index 75d10e7ab261..fc0a71e7ab5e 100644 --- a/crates/biome_js_analyze/src/syntax/correctness.rs +++ b/crates/biome_js_analyze/src/syntax/correctness.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_json_analyze/src/assist.rs b/crates/biome_json_analyze/src/assist.rs index 6174b359db67..eda0eb9b2532 100644 --- a/crates/biome_json_analyze/src/assist.rs +++ b/crates/biome_json_analyze/src/assist.rs @@ -1,6 +1,4 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod source; ::biome_analyze::declare_category! { pub Assist { kind : Action , groups : [self :: source :: Source ,] } } diff --git a/crates/biome_json_analyze/src/assist/source.rs b/crates/biome_json_analyze/src/assist/source.rs index eb2410e3ccaa..f0782dff3c86 100644 --- a/crates/biome_json_analyze/src/assist/source.rs +++ b/crates/biome_json_analyze/src/assist/source.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_json_analyze/src/assists.rs b/crates/biome_json_analyze/src/assists.rs index 64dd24c3e483..5d86871448da 100644 --- a/crates/biome_json_analyze/src/assists.rs +++ b/crates/biome_json_analyze/src/assists.rs @@ -1,6 +1,4 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod source; ::biome_analyze::declare_category! { pub Assists { kind : Action , groups : [self :: source :: Source ,] } } diff --git a/crates/biome_json_analyze/src/lint.rs b/crates/biome_json_analyze/src/lint.rs index 87c4bcee6dda..a38ffdf91ed4 100644 --- a/crates/biome_json_analyze/src/lint.rs +++ b/crates/biome_json_analyze/src/lint.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - pub mod nursery; pub mod suspicious; ::biome_analyze::declare_category! { pub Lint { kind : Lint , groups : [self :: nursery :: Nursery , self :: suspicious :: Suspicious ,] } } diff --git a/crates/biome_json_analyze/src/lint/nursery.rs b/crates/biome_json_analyze/src/lint/nursery.rs index 43d1a4f1a4e7..5b920c140e7f 100644 --- a/crates/biome_json_analyze/src/lint/nursery.rs +++ b/crates/biome_json_analyze/src/lint/nursery.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_json_analyze/src/lint/suspicious.rs b/crates/biome_json_analyze/src/lint/suspicious.rs index 9c4e7a565abd..444958b451a9 100644 --- a/crates/biome_json_analyze/src/lint/suspicious.rs +++ b/crates/biome_json_analyze/src/lint/suspicious.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - #![doc = r" Group description generated by proc macro at compile time."] #![doc = r""] #![doc = r" To add a new rule, create a `.rs` file in the group subdirectory"] diff --git a/crates/biome_json_analyze/src/registry.rs b/crates/biome_json_analyze/src/registry.rs index 4ecd19a5eacc..ee55960dcef8 100644 --- a/crates/biome_json_analyze/src/registry.rs +++ b/crates/biome_json_analyze/src/registry.rs @@ -1,7 +1,5 @@ //! Generated file, do not edit by hand, see `xtask/codegen` -//! Generated file, do not edit by hand, see `xtask/codegen` - use biome_analyze::RegistryVisitor; use biome_json_syntax::JsonLanguage; pub fn visit_registry>(registry: &mut V) { diff --git a/xtask/codegen/src/generate_analyzer.rs b/xtask/codegen/src/generate_analyzer.rs index ae623431ef3d..fbf85eb0c1b4 100644 --- a/xtask/codegen/src/generate_analyzer.rs +++ b/xtask/codegen/src/generate_analyzer.rs @@ -9,7 +9,6 @@ use xtask_glue::{glue::fs2, project_root, reformat}; fn generate_build_script(categories_and_groups: &BTreeMap<&str, Vec>) -> Result { let mut watch_calls = Vec::new(); - // Generate watch_group calls for each category and group for (category, groups) in categories_and_groups { if groups.is_empty() { continue; @@ -17,20 +16,6 @@ fn generate_build_script(categories_and_groups: &BTreeMap<&str, Vec>) -> let mut groups = groups.clone(); groups.sort(); - // Add category comment - let _category_comment = match *category { - "lint" => "Lint groups", - "assist" => "Assist groups", - "syntax" => "Syntax groups", - _ => { - let mut title = category.to_string(); - if let Some(first_char) = title.get_mut(0..1) { - first_char.make_ascii_uppercase(); - } - &format!("{} groups", title) - } - }; - for group in groups { watch_calls.push(quote! { watch_group(#category, #group)?; @@ -102,159 +87,59 @@ fn generate_build_script(categories_and_groups: &BTreeMap<&str, Vec>) -> reformat(tokens) } -pub fn generate_analyzer() -> Result<()> { - generate_js_analyzer()?; - generate_json_analyzer()?; - generate_css_analyzer()?; - generate_graphql_analyzer()?; - generate_html_analyzer()?; - Ok(()) -} - -fn generate_js_analyzer() -> Result<()> { - let base_path = project_root().join("crates/biome_js_analyze/src"); - let mut analyzers = BTreeMap::new(); - let mut categories_and_groups = BTreeMap::new(); - - // Check if lint directory exists - let lint_path = base_path.join("lint"); - if lint_path.exists() { - let lint_groups = generate_category("lint", &mut analyzers, &base_path)?; - if !lint_groups.is_empty() { - categories_and_groups.insert("lint", lint_groups); - } - } - - // Check if assist directory exists - let assist_path = base_path.join("assist"); - if assist_path.exists() { - let assist_groups = generate_category("assist", &mut analyzers, &base_path)?; - if !assist_groups.is_empty() { - categories_and_groups.insert("assist", assist_groups); - } - } - - // Check if syntax directory exists - let syntax_path = base_path.join("syntax"); - if syntax_path.exists() { - let syntax_groups = generate_category("syntax", &mut analyzers, &base_path)?; - if !syntax_groups.is_empty() { - categories_and_groups.insert("syntax", syntax_groups); - } - } - - // Generate and write build.rs - let build_script = generate_build_script(&categories_and_groups)?; - let build_rs_path = project_root().join("crates/biome_js_analyze/build.rs"); - fs2::write(build_rs_path, build_script)?; - - update_js_registry_builder(analyzers) -} - -fn generate_json_analyzer() -> Result<()> { - let base_path = project_root().join("crates/biome_json_analyze/src"); - let mut analyzers = BTreeMap::new(); - let mut categories_and_groups = BTreeMap::new(); - - // Check if lint directory exists - let lint_path = base_path.join("lint"); - if lint_path.exists() { - let lint_groups = generate_category("lint", &mut analyzers, &base_path)?; - if !lint_groups.is_empty() { - categories_and_groups.insert("lint", lint_groups); - } - } - - // Check if assist directory exists - let assist_path = base_path.join("assist"); - if assist_path.exists() { - let assist_groups = generate_category("assist", &mut analyzers, &base_path)?; - if !assist_groups.is_empty() { - categories_and_groups.insert("assist", assist_groups); - } - } - - // Generate and write build.rs - let build_script = generate_build_script(&categories_and_groups)?; - let build_rs_path = project_root().join("crates/biome_json_analyze/build.rs"); - fs2::write(build_rs_path, build_script)?; - - update_json_registry_builder(analyzers) -} - -fn generate_css_analyzer() -> Result<()> { - let base_path = project_root().join("crates/biome_css_analyze/src"); - let mut analyzers = BTreeMap::new(); - let mut categories_and_groups = BTreeMap::new(); - - // Check if lint directory exists - let lint_path = base_path.join("lint"); - if lint_path.exists() { - let lint_groups = generate_category("lint", &mut analyzers, &base_path)?; - if !lint_groups.is_empty() { - categories_and_groups.insert("lint", lint_groups); - } - } - - // Check if assist directory exists - let assist_path = base_path.join("assist"); - if assist_path.exists() { - let assist_groups = generate_category("assist", &mut analyzers, &base_path)?; - if !assist_groups.is_empty() { - categories_and_groups.insert("assist", assist_groups); - } - } - - // Generate and write build.rs - let build_script = generate_build_script(&categories_and_groups)?; - let build_rs_path = project_root().join("crates/biome_css_analyze/build.rs"); - fs2::write(build_rs_path, build_script)?; - - update_css_registry_builder(analyzers) -} - -fn generate_graphql_analyzer() -> Result<()> { - let base_path = project_root().join("crates/biome_graphql_analyze/src"); +/// Generate an analyzer crate's category files, build script, and registry. +fn generate_analyzer_crate( + crate_name: &str, + categories: &[&'static str], + update_registry: fn(BTreeMap<&'static str, TokenStream>) -> Result<()>, +) -> Result<()> { + let base_path = project_root().join(format!("crates/{crate_name}/src")); let mut analyzers = BTreeMap::new(); let mut categories_and_groups = BTreeMap::new(); - // Check if lint directory exists - let lint_path = base_path.join("lint"); - if lint_path.exists() { - let lint_groups = generate_category("lint", &mut analyzers, &base_path)?; - if !lint_groups.is_empty() { - categories_and_groups.insert("lint", lint_groups); + for &category in categories { + if base_path.join(category).exists() { + let groups = generate_category(category, &mut analyzers, &base_path)?; + if !groups.is_empty() { + categories_and_groups.insert(category, groups); + } } } - // Generate and write build.rs let build_script = generate_build_script(&categories_and_groups)?; - let build_rs_path = project_root().join("crates/biome_graphql_analyze/build.rs"); + let build_rs_path = project_root().join(format!("crates/{crate_name}/build.rs")); fs2::write(build_rs_path, build_script)?; - update_graphql_registry_builder(analyzers) + update_registry(analyzers) } -fn generate_html_analyzer() -> Result<()> { - let base_path = project_root().join("crates/biome_html_analyze/src"); - let mut analyzers = BTreeMap::new(); - let mut categories_and_groups = BTreeMap::new(); - - // Check if lint directory exists - let lint_path = base_path.join("lint"); - if lint_path.exists() { - let lint_groups = generate_category("lint", &mut analyzers, &base_path)?; - if !lint_groups.is_empty() { - categories_and_groups.insert("lint", lint_groups); - } - } - - // Generate and write build.rs - let build_script = generate_build_script(&categories_and_groups)?; - let build_rs_path = project_root().join("crates/biome_html_analyze/build.rs"); - fs2::write(build_rs_path, build_script)?; - - update_html_registry_builder(analyzers) +pub fn generate_analyzer() -> Result<()> { + generate_analyzer_crate( + "biome_js_analyze", + &["lint", "assist", "syntax"], + update_js_registry_builder, + )?; + generate_analyzer_crate( + "biome_json_analyze", + &["lint", "assist"], + update_json_registry_builder, + )?; + generate_analyzer_crate( + "biome_css_analyze", + &["lint", "assist"], + update_css_registry_builder, + )?; + generate_analyzer_crate( + "biome_graphql_analyze", + &["lint"], + update_graphql_registry_builder, + )?; + generate_analyzer_crate( + "biome_html_analyze", + &["lint"], + update_html_registry_builder, + )?; + Ok(()) } fn generate_category( @@ -299,7 +184,6 @@ fn generate_category( ); } - let key = name; let module_name = format_ident!("{name}"); let category_name = Case::Pascal.convert(name); @@ -313,14 +197,14 @@ fn generate_category( }; entries.insert( - key, + name, quote! { registry.record_category::(); }, ); let (modules, paths): (Vec<_>, Vec<_>) = groups.into_values().unzip(); - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { #( #modules )* ::biome_analyze::declare_category! { pub #category_name { @@ -332,7 +216,6 @@ fn generate_category( } })?; - let tokens = reformat(tokens)?; fs2::write(base_path.join(format!("{name}.rs")), tokens)?; Ok(group_names) @@ -340,7 +223,7 @@ fn generate_category( fn generate_group(category: &'static str, group: &str, base_path: &Path) -> Result<()> { // Generate simple proc macro invocation instead of full code - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { //! Group description generated by proc macro at compile time. //! //! To add a new rule, create a `.rs` file in the group subdirectory @@ -355,7 +238,6 @@ fn generate_group(category: &'static str, group: &str, base_path: &Path) -> Resu } })?; - let tokens = reformat(tokens)?; fs2::write(base_path.join(category).join(format!("{group}.rs")), tokens)?; Ok(()) @@ -366,7 +248,7 @@ fn update_js_registry_builder(analyzers: BTreeMap<&'static str, TokenStream>) -> let categories = analyzers.into_values(); - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { use biome_analyze::RegistryVisitor; use biome_js_syntax::JsLanguage; @@ -385,7 +267,7 @@ fn update_json_registry_builder(analyzers: BTreeMap<&'static str, TokenStream>) let categories = analyzers.into_values(); - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { use biome_analyze::RegistryVisitor; use biome_json_syntax::JsonLanguage; @@ -394,7 +276,6 @@ fn update_json_registry_builder(analyzers: BTreeMap<&'static str, TokenStream>) } })?; - let tokens = reformat(tokens)?; fs2::write(path, tokens)?; Ok(()) @@ -405,7 +286,7 @@ fn update_css_registry_builder(analyzers: BTreeMap<&'static str, TokenStream>) - let categories = analyzers.into_values(); - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { use biome_analyze::RegistryVisitor; use biome_css_syntax::CssLanguage; @@ -414,7 +295,6 @@ fn update_css_registry_builder(analyzers: BTreeMap<&'static str, TokenStream>) - } })?; - let tokens = reformat(tokens)?; fs2::write(path, tokens)?; Ok(()) @@ -425,7 +305,7 @@ fn update_graphql_registry_builder(analyzers: BTreeMap<&'static str, TokenStream let categories = analyzers.into_values(); - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { use biome_analyze::RegistryVisitor; use biome_graphql_syntax::GraphqlLanguage; @@ -444,7 +324,7 @@ fn update_html_registry_builder(analyzers: BTreeMap<&'static str, TokenStream>) let categories = analyzers.into_values(); - let tokens = xtask_glue::reformat(quote! { + let tokens = reformat(quote! { use biome_analyze::RegistryVisitor; use biome_html_syntax::HtmlLanguage; diff --git a/xtask/glue/src/lib.rs b/xtask/glue/src/lib.rs index 52952962c4fb..711e89ee8043 100644 --- a/xtask/glue/src/lib.rs +++ b/xtask/glue/src/lib.rs @@ -52,6 +52,11 @@ pub fn reformat_with_command(text: impl Display, command: impl Display) -> Resul pub const PREAMBLE: &str = "Generated file, do not edit by hand, see `xtask/codegen`"; pub fn prepend_generated_preamble(content: impl Display) -> String { + let content = content.to_string(); + assert!( + !content.contains(PREAMBLE), + "content already contains the generated preamble — was reformat() called twice?" + ); format!("//! {PREAMBLE}\n\n{content}") } @@ -100,3 +105,22 @@ pub fn ensure_rustfmt() -> Result<()> { Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn prepend_generated_preamble_adds_preamble() { + let result = prepend_generated_preamble("fn main() {}"); + assert!(result.starts_with("//!")); + assert_eq!(result.matches(PREAMBLE).count(), 1); + } + + #[test] + #[should_panic(expected = "content already contains the generated preamble")] + fn prepend_generated_preamble_rejects_duplicate() { + let once = prepend_generated_preamble("fn main() {}"); + prepend_generated_preamble(once); + } +}