Skip to content

Commit

Permalink
fix(alloy-sol-macro): allow clippy::pub_underscore_fields on sol! o…
Browse files Browse the repository at this point in the history
…utput (#770)
  • Loading branch information
benluelo authored Oct 10, 2024
1 parent 5d87767 commit 7490294
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/sol-macro-expander/src/expand/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ pub(super) fn expand(cx: &mut ExpCtxt<'_>, contract: &ItemContract) -> Result<To
#mod_descr_doc
#(#mod_attrs)*
#mod_iface_doc
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
pub mod #name {
use super::*;
use #alloy_sol_types as alloy_sol_types;
Expand Down
4 changes: 2 additions & 2 deletions crates/sol-macro-expander/src/expand/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, enumm: &ItemEnum) -> Result<TokenStream>
let tokens = quote! {
#(#attrs)*
#doc
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
#[derive(Clone, Copy)]
#[repr(u8)]
pub enum #name {
#variants
#invalid_variant
}

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
const _: () = {
use #alloy_sol_types as alloy_sol_types;

Expand Down
4 changes: 2 additions & 2 deletions crates/sol-macro-expander/src/expand/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, error: &ItemError) -> Result<TokenStream>
let tokens = quote! {
#(#attrs)*
#doc
#[allow(non_camel_case_types, non_snake_case)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct #name {
#(#fields),*
}

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
const _: () = {
use #alloy_sol_types as alloy_sol_types;

Expand Down
4 changes: 2 additions & 2 deletions crates/sol-macro-expander/src/expand/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, event: &ItemEvent) -> Result<TokenStream>
let tokens = quote! {
#(#attrs)*
#doc
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
#[derive(Clone)]
pub struct #name {
#(
Expand All @@ -157,7 +157,7 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, event: &ItemEvent) -> Result<TokenStream>
)*
}

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
const _: () = {
use #alloy_sol_types as alloy_sol_types;

Expand Down
8 changes: 4 additions & 4 deletions crates/sol-macro-expander/src/expand/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,21 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, function: &ItemFunction) -> Result<TokenS
let tokens = quote! {
#(#call_attrs)*
#call_doc
#[allow(non_camel_case_types, non_snake_case)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct #call_name {
#(#call_fields),*
}

#(#return_attrs)*
#return_doc
#[allow(non_camel_case_types, non_snake_case)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct #return_name {
#(#return_fields),*
}

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
const _: () = {
use #alloy_sol_types as alloy_sol_types;

Expand Down Expand Up @@ -182,7 +182,7 @@ fn expand_constructor(cx: &ExpCtxt<'_>, constructor: &ItemFunction) -> Result<To
let tokens = quote! {
#(#call_attrs)*
#call_doc
#[allow(non_camel_case_types, non_snake_case)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct #call_name {
#(#call_fields),*
Expand Down
4 changes: 2 additions & 2 deletions crates/sol-macro-expander/src/expand/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, s: &ItemStruct) -> Result<TokenStream> {
let tokens = quote! {
#(#attrs)*
#doc
#[allow(non_camel_case_types, non_snake_case)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct #name {
#(#fields),*
}

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields, clippy::style)]
const _: () = {
use #alloy_sol_types as alloy_sol_types;

Expand Down
2 changes: 1 addition & 1 deletion crates/sol-macro-expander/src/expand/udt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, udt: &ItemUdt) -> Result<TokenStream> {

let tokens = quote! {
#(#attrs)*
#[allow(non_camel_case_types, non_snake_case)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct #name(#underlying_rust);

Expand Down

0 comments on commit 7490294

Please sign in to comment.