Add #[allow(clippy::all, clippy::pedantic)]
for all macros generated code. #192
This commit is contained in:
parent
6565e0aad7
commit
914b308ec2
|
@ -75,12 +75,14 @@ pub fn generate(enum_args: &args::Enum, input: &DeriveInput) -> Result<TokenStre
|
|||
}
|
||||
|
||||
let expanded = quote! {
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #crate_name::EnumType for #ident {
|
||||
fn items() -> &'static [#crate_name::EnumItem<#ident>] {
|
||||
&[#(#items),*]
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #crate_name::Type for #ident {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -101,6 +103,7 @@ pub fn generate(enum_args: &args::Enum, input: &DeriveInput) -> Result<TokenStre
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #crate_name::InputValueType for #ident {
|
||||
fn parse(value: Option<#crate_name::Value>) -> #crate_name::InputValueResult<Self> {
|
||||
#crate_name::EnumType::parse_enum(value.unwrap_or_default())
|
||||
|
|
|
@ -99,6 +99,7 @@ pub fn generate(object_args: &args::InputObject, input: &DeriveInput) -> Result<
|
|||
}
|
||||
|
||||
let expanded = quote! {
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #crate_name::Type for #ident {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -117,6 +118,7 @@ pub fn generate(object_args: &args::InputObject, input: &DeriveInput) -> Result<
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #crate_name::InputValueType for #ident {
|
||||
fn parse(value: Option<#crate_name::Value>) -> #crate_name::InputValueResult<Self> {
|
||||
use #crate_name::Type;
|
||||
|
|
|
@ -76,6 +76,7 @@ pub fn generate(interface_args: &args::Interface, input: &DeriveInput) -> Result
|
|||
}
|
||||
|
||||
type_into_impls.push(quote! {
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics From<#p> for #ident #generics {
|
||||
fn from(obj: #p) -> Self {
|
||||
#ident::#enum_name(obj)
|
||||
|
@ -263,10 +264,12 @@ pub fn generate(interface_args: &args::Interface, input: &DeriveInput) -> Result
|
|||
let expanded = quote! {
|
||||
#(#type_into_impls)*
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #ident #generics {
|
||||
#(#methods)*
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #crate_name::Type for #ident #generics {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -300,6 +303,7 @@ pub fn generate(interface_args: &args::Interface, input: &DeriveInput) -> Result
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::ObjectType for #ident #generics {
|
||||
async fn resolve_field(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
@ -321,6 +325,7 @@ pub fn generate(interface_args: &args::Interface, input: &DeriveInput) -> Result
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::OutputValueType for #ident #generics {
|
||||
async fn resolve(&self, ctx: &#crate_name::ContextSelectionSet<'_>, _field: &#crate_name::Positioned<#crate_name::parser::query::Field>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
|
|
@ -463,6 +463,7 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
let expanded = quote! {
|
||||
#item_impl
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #crate_name::Type for #self_ty #where_clause {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -487,7 +488,7 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_braces, unused_parens)]
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl#generics #crate_name::ObjectType for #self_ty #where_clause {
|
||||
async fn resolve_field(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
@ -514,6 +515,7 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::OutputValueType for #self_ty #where_clause {
|
||||
async fn resolve(&self, ctx: &#crate_name::ContextSelectionSet<'_>, _field: &#crate_name::Positioned<#crate_name::parser::query::Field>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
|
|
@ -31,6 +31,7 @@ pub fn generate(scalar_args: &args::Scalar, item_impl: &mut ItemImpl) -> Result<
|
|||
let expanded = quote! {
|
||||
#item_impl
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generic #crate_name::Type for #self_ty #where_clause {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -45,6 +46,7 @@ pub fn generate(scalar_args: &args::Scalar, item_impl: &mut ItemImpl) -> Result<
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generic #crate_name::InputValueType for #self_ty #where_clause {
|
||||
fn parse(value: Option<#crate_name::Value>) -> #crate_name::InputValueResult<Self> {
|
||||
<#self_ty as #crate_name::ScalarType>::parse(value.unwrap_or_default())
|
||||
|
@ -55,7 +57,7 @@ pub fn generate(scalar_args: &args::Scalar, item_impl: &mut ItemImpl) -> Result<
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::ptr_arg)]
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generic #crate_name::OutputValueType for #self_ty #where_clause {
|
||||
async fn resolve(
|
||||
|
|
|
@ -154,10 +154,12 @@ pub fn generate(object_args: &args::Object, input: &DeriveInput) -> Result<Token
|
|||
};
|
||||
|
||||
let expanded = quote! {
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #ident #where_clause {
|
||||
#(#getters)*
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #crate_name::Type for #ident #generics #where_clause {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -179,6 +181,7 @@ pub fn generate(object_args: &args::Object, input: &DeriveInput) -> Result<Token
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::ObjectType for #ident #generics #where_clause {
|
||||
async fn resolve_field(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
@ -190,6 +193,7 @@ pub fn generate(object_args: &args::Object, input: &DeriveInput) -> Result<Token
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::OutputValueType for #ident #generics #where_clause {
|
||||
async fn resolve(&self, ctx: &#crate_name::ContextSelectionSet<'_>, _field: &#crate_name::Positioned<#crate_name::parser::query::Field>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
|
|
@ -310,6 +310,7 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
let expanded = quote! {
|
||||
#item_impl
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #crate_name::Type for #self_ty #where_clause {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -332,10 +333,9 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #crate_name::SubscriptionType for #self_ty #where_clause {
|
||||
#[allow(unused_variables)]
|
||||
#[allow(bare_trait_objects)]
|
||||
async fn create_field_stream(
|
||||
&self,
|
||||
idx: usize,
|
||||
|
|
|
@ -69,6 +69,7 @@ pub fn generate(union_args: &args::Interface, input: &DeriveInput) -> Result<Tok
|
|||
|
||||
enum_names.push(enum_name);
|
||||
type_into_impls.push(quote! {
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics From<#p> for #ident #generics {
|
||||
fn from(obj: #p) -> Self {
|
||||
#ident::#enum_name(obj)
|
||||
|
@ -97,6 +98,7 @@ pub fn generate(union_args: &args::Interface, input: &DeriveInput) -> Result<Tok
|
|||
let expanded = quote! {
|
||||
#(#type_into_impls)*
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
impl #generics #crate_name::Type for #ident #generics {
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
|
@ -125,6 +127,7 @@ pub fn generate(union_args: &args::Interface, input: &DeriveInput) -> Result<Tok
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::ObjectType for #ident #generics {
|
||||
async fn resolve_field(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
@ -145,6 +148,7 @@ pub fn generate(union_args: &args::Interface, input: &DeriveInput) -> Result<Tok
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all, clippy::pedantic)]
|
||||
#[#crate_name::async_trait::async_trait]
|
||||
impl #generics #crate_name::OutputValueType for #ident #generics {
|
||||
async fn resolve(&self, ctx: &#crate_name::ContextSelectionSet<'_>, _field: &#crate_name::Positioned<#crate_name::parser::query::Field>) -> #crate_name::Result<#crate_name::serde_json::Value> {
|
||||
|
|
Loading…
Reference in New Issue
Block a user