Skip to content

Commit

Permalink
refactor(ast): remove unneeded lint attrs from generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Feb 3, 2025
1 parent 705208b commit 14a3737
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 79 deletions.
44 changes: 1 addition & 43 deletions crates/oxc_ast/src/generated/derive_content_eq.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/derives/estree.rs`

#![allow(unused_imports, unused_mut, clippy::match_same_arms)]
#![allow(unused_imports, clippy::match_same_arms)]

use serde::{ser::SerializeMap, Serialize, Serializer};

Expand Down
9 changes: 1 addition & 8 deletions crates/oxc_ast/src/generated/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
//! * [visitor pattern](https://rust-unofficial.github.io/patterns/patterns/behavioural/visitor.html)
//! * [rustc visitor](https://github.com/rust-lang/rust/blob/1.82.0/compiler/rustc_ast/src/visit.rs)
#![allow(
unused_variables,
clippy::extra_unused_type_parameters,
clippy::explicit_iter_loop,
clippy::self_named_module_files,
clippy::semicolon_if_nothing_returned,
clippy::match_wildcard_for_single_variants
)]
#![allow(unused_variables, clippy::semicolon_if_nothing_returned)]

use std::cell::Cell;

Expand Down
9 changes: 1 addition & 8 deletions crates/oxc_ast/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
//! * [visitor pattern](https://rust-unofficial.github.io/patterns/patterns/behavioural/visitor.html)
//! * [rustc visitor](https://github.com/rust-lang/rust/blob/1.82.0/compiler/rustc_ast/src/visit.rs)
#![allow(
unused_variables,
clippy::extra_unused_type_parameters,
clippy::explicit_iter_loop,
clippy::self_named_module_files,
clippy::semicolon_if_nothing_returned,
clippy::match_wildcard_for_single_variants
)]
#![allow(unused_variables, clippy::semicolon_if_nothing_returned)]

use std::cell::Cell;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/derives/content_eq.rs`

#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::match_same_arms)]

use oxc_span::cmp::ContentEq;

Expand All @@ -27,7 +27,6 @@ impl ContentEq for Alternative<'_> {

impl ContentEq for Term<'_> {
fn content_eq(&self, other: &Self) -> bool {
#[allow(clippy::match_same_arms)]
match (self, other) {
(Self::BoundaryAssertion(a), Self::BoundaryAssertion(b)) => a.content_eq(b),
(Self::LookAroundAssertion(a), Self::LookAroundAssertion(b)) => a.content_eq(b),
Expand Down Expand Up @@ -137,7 +136,6 @@ impl ContentEq for CharacterClassContentsKind {

impl ContentEq for CharacterClassContents<'_> {
fn content_eq(&self, other: &Self) -> bool {
#[allow(clippy::match_same_arms)]
match (self, other) {
(Self::CharacterClassRange(a), Self::CharacterClassRange(b)) => a.content_eq(b),
(Self::CharacterClassEscape(a), Self::CharacterClassEscape(b)) => a.content_eq(b),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/derives/estree.rs`

#![allow(unused_imports, unused_mut, clippy::match_same_arms)]
#![allow(unused_imports, clippy::match_same_arms)]

use serde::{ser::SerializeMap, Serialize, Serializer};

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_span/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/derives/estree.rs`

#![allow(unused_imports, unused_mut, clippy::match_same_arms)]
#![allow(unused_imports, clippy::match_same_arms)]

use serde::{ser::SerializeMap, Serialize, Serializer};

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_syntax/src/generated/derive_content_eq.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/derives/content_eq.rs`

#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::match_same_arms)]

use oxc_span::cmp::ContentEq;

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_syntax/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/derives/estree.rs`

#![allow(unused_imports, unused_mut, clippy::match_same_arms)]
#![allow(unused_imports, clippy::match_same_arms)]

use serde::{ser::SerializeMap, Serialize, Serializer};

Expand Down
4 changes: 1 addition & 3 deletions tasks/ast_tools/src/derives/content_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ impl Derive for DeriveContentEq {

fn prelude(&self) -> TokenStream {
quote! {
// NOTE: writing long match expressions formats better than using `matches` macro.
#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::match_same_arms)]

///@@line_break
use oxc_span::cmp::ContentEq;
Expand Down Expand Up @@ -74,7 +73,6 @@ fn derive_enum(enum_def: &EnumDef, schema: &Schema) -> TokenStream {
}
});
quote! {
#[allow(clippy::match_same_arms)]
match (self, other) {
#(#matches,)*
_ => false,
Expand Down
2 changes: 1 addition & 1 deletion tasks/ast_tools/src/derives/estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Derive for DeriveESTree {

fn prelude(&self) -> TokenStream {
quote! {
#![allow(unused_imports, unused_mut, clippy::match_same_arms)]
#![allow(unused_imports, clippy::match_same_arms)]

///@@line_break
use serde::{Serialize, Serializer, ser::SerializeMap};
Expand Down
9 changes: 1 addition & 8 deletions tasks/ast_tools/src/generators/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,7 @@ fn generate_output(
//! * [rustc visitor](https://github.com/rust-lang/rust/blob/1.82.0/compiler/rustc_ast/src/visit.rs)
//!@@line_break
#![allow(
unused_variables,
clippy::extra_unused_type_parameters,
clippy::explicit_iter_loop,
clippy::self_named_module_files,
clippy::semicolon_if_nothing_returned,
clippy::match_wildcard_for_single_variants
)]
#![allow(unused_variables, clippy::semicolon_if_nothing_returned)]

///@@line_break
use std::cell::Cell;
Expand Down

0 comments on commit 14a3737

Please sign in to comment.