diff --git a/diesel_cli/src/print_schema.rs b/diesel_cli/src/print_schema.rs index b11d1ee84846..dbe7f4768bd5 100644 --- a/diesel_cli/src/print_schema.rs +++ b/diesel_cli/src/print_schema.rs @@ -555,6 +555,7 @@ impl<'a> Display for TableDefinition<'a> { { if already_imported_custom_types.insert(&ct.rust_name) { if !has_written_import { + writeln!(out, "#[allow(clippy::pedantic)]")?; writeln!(out, "use diesel::sql_types::*;")?; } writeln!(out, "use super::sql_types::{};", ct.rust_name)?; diff --git a/diesel_cli/tests/print_schema/print_schema_custom_types_check_default_derives/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_custom_types_check_default_derives/postgres/expected.snap index d18919f3ecdd..d8f26c3fbf4a 100644 --- a/diesel_cli/tests/print_schema/print_schema_custom_types_check_default_derives/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_custom_types_check_default_derives/postgres/expected.snap @@ -24,6 +24,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::MyType; use super::sql_types::MyType2; diff --git a/diesel_cli/tests/print_schema/print_schema_custom_types_overriding_derives_works/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_custom_types_overriding_derives_works/postgres/expected.snap index 539046949762..520c34ab75d2 100644 --- a/diesel_cli/tests/print_schema/print_schema_custom_types_overriding_derives_works/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_custom_types_overriding_derives_works/postgres/expected.snap @@ -24,6 +24,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::MyType; use super::sql_types::MyType2; diff --git a/diesel_cli/tests/print_schema/print_schema_default_is_to_generate_custom_types/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_default_is_to_generate_custom_types/postgres/expected.snap index 757c3d1ffe6b..f4e10a82c442 100644 --- a/diesel_cli/tests/print_schema/print_schema_default_is_to_generate_custom_types/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_default_is_to_generate_custom_types/postgres/expected.snap @@ -24,6 +24,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::MyType; use super::sql_types::MyType2; diff --git a/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.rs b/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.rs index e0c58fabfec8..776538150831 100644 --- a/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.rs +++ b/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.rs @@ -20,6 +20,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::MyType; use super::sql_types::MyType2; diff --git a/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.snap index 845b8000ea10..93acfc1e518b 100644 --- a/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_respects_type_name_case/postgres/expected.snap @@ -24,6 +24,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::MyType; use super::sql_types::MyType2; diff --git a/diesel_cli/tests/print_schema/print_schema_specifying_schema_name_with_custom_type/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_specifying_schema_name_with_custom_type/postgres/expected.snap index bf6bfed0a835..f0e26d41ed7d 100644 --- a/diesel_cli/tests/print_schema/print_schema_specifying_schema_name_with_custom_type/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_specifying_schema_name_with_custom_type/postgres/expected.snap @@ -18,6 +18,7 @@ pub mod custom_schema { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::MyEnum; diff --git a/diesel_cli/tests/print_schema/print_schema_type_renaming/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_type_renaming/postgres/expected.snap index 61e680a517e6..61f63bec62b5 100644 --- a/diesel_cli/tests/print_schema/print_schema_type_renaming/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_type_renaming/postgres/expected.snap @@ -17,6 +17,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::UserJob; diff --git a/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/mysql/expected.snap b/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/mysql/expected.snap index cfa188fcfc1b..58f7de68a11e 100644 --- a/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/mysql/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/mysql/expected.snap @@ -26,6 +26,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::Users1UserStateEnum; use super::sql_types::Users1EnabledFeaturesSet; diff --git a/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/postgres/expected.snap b/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/postgres/expected.snap index f0a0fc7b6423..207dd38430c9 100644 --- a/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/postgres/expected.snap +++ b/diesel_cli/tests/print_schema/print_schema_with_enum_set_types/postgres/expected.snap @@ -24,6 +24,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::SomeEnum; use super::sql_types::SomeEnum2; diff --git a/examples/postgres/custom_types/src/schema.rs b/examples/postgres/custom_types/src/schema.rs index 69b72bdc0d36..88adab937916 100644 --- a/examples/postgres/custom_types/src/schema.rs +++ b/examples/postgres/custom_types/src/schema.rs @@ -7,6 +7,7 @@ pub mod sql_types { } diesel::table! { + #[allow(clippy::pedantic)] use diesel::sql_types::*; use super::sql_types::Language;