Stop Clippy from enforcing # Errors
and # Panics
sections in GraphQL descriptions
This commit is contained in:
parent
813c0d1210
commit
3645df27b6
8 changed files with 33 additions and 0 deletions
1
Makefile
1
Makefile
|
@ -55,6 +55,7 @@ cargo.fmt:
|
|||
|
||||
cargo.lint:
|
||||
cargo clippy --workspace --all-features -- -D warnings
|
||||
cargo clippy -p juniper_integration_tests --tests --all-features -- -D warnings
|
||||
|
||||
|
||||
# Release Rust crate.
|
||||
|
|
|
@ -136,6 +136,8 @@ fn expand_on_trait(
|
|||
};
|
||||
|
||||
Ok(quote! {
|
||||
// Omit enforcing `# Errors` and `# Panics` sections in GraphQL descriptions.
|
||||
#[allow(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
||||
#ast
|
||||
#generated_code
|
||||
})
|
||||
|
|
|
@ -127,6 +127,8 @@ where
|
|||
};
|
||||
|
||||
Ok(quote! {
|
||||
// Omit enforcing `# Errors` and `# Panics` sections in GraphQL descriptions.
|
||||
#[allow(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
||||
#ast
|
||||
#generated_code
|
||||
})
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
//! Tests for `#[graphql_interface]` macro placed on a trait.
|
||||
|
||||
// Assert that `#[graphql_interface]` macro placed on a trait stops Clippy from enforcing `# Errors`
|
||||
// and `# Panics` sections in GraphQL descriptions.
|
||||
#![deny(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
||||
|
||||
pub mod common;
|
||||
|
||||
use juniper::{
|
||||
|
@ -2370,6 +2374,7 @@ mod explicit_custom_context {
|
|||
|
||||
#[graphql_object(impl = CharacterValue, context = CustomContext)]
|
||||
impl Droid {
|
||||
#[allow(clippy::needless_lifetimes)] // intentionally
|
||||
async fn id<'a>(&'a self) -> &'a str {
|
||||
&self.id
|
||||
}
|
||||
|
@ -2378,6 +2383,7 @@ mod explicit_custom_context {
|
|||
&self.primary_function
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_lifetimes)] // intentionally
|
||||
async fn info<'b>(&'b self) -> &'b str {
|
||||
&self.primary_function
|
||||
}
|
||||
|
@ -2678,6 +2684,7 @@ mod executor {
|
|||
&self.home_planet
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_lifetimes)] // intentionally
|
||||
async fn info<'b>(&'b self, _arg: prelude::Option<i32>) -> &'b str {
|
||||
&self.home_planet
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
//! Tests for `#[graphql_object]` macro.
|
||||
|
||||
// Assert that `#[graphql_object]` macro placed on a `impl` stops Clippy from enforcing `# Errors`
|
||||
// and `# Panics` sections in GraphQL descriptions.
|
||||
#![deny(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
||||
|
||||
pub mod common;
|
||||
|
||||
use juniper::{
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
//! Tests for `#[graphql_subscription]` macro.
|
||||
|
||||
// Assert that `#[graphql_subscription]` macro placed on a `impl` stops Clippy from enforcing
|
||||
// `# Errors` and `# Panics` sections in GraphQL descriptions.
|
||||
#![deny(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
||||
|
||||
pub mod common;
|
||||
|
||||
use std::pin::Pin;
|
||||
|
|
|
@ -41,6 +41,17 @@ pub mod util {
|
|||
/// Extracts a single next value from the result returned by
|
||||
/// [`juniper::resolve_into_stream()`] and transforms it into a regular
|
||||
/// [`Value`].
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Propagates the `input` [`GraphQLError`], if any.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// If the `input` [`Value`] doesn't represent a [`Value::Object`] containing a [`Stream`].
|
||||
///
|
||||
/// [`Stream`]: futures::Stream
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub async fn extract_next<S: ScalarValue>(
|
||||
input: Result<(Value<ValuesStream<'_, S>>, Vec<ExecutionError<S>>), GraphQLError>,
|
||||
) -> Result<(Value<S>, Vec<ExecutionError<S>>), GraphQLError> {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
//! Checks that multiple fragments on sub types don't override each other.
|
||||
//! See [#914](https://github.com/graphql-rust/juniper/issues/914) for details.
|
||||
|
||||
#![allow(clippy::disallowed_names)]
|
||||
|
||||
use juniper::{graphql_object, graphql_vars, EmptyMutation, EmptySubscription, GraphQLObject};
|
||||
|
||||
struct Query;
|
||||
|
|
Loading…
Reference in a new issue