Skip to content

Commit

Permalink
Suggest using #[allow(clippy::all)] for bindings
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula committed Jan 20, 2024
1 parent 51c1e3b commit a47ba4d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ fn main() {
Afterwards, include the generated bindings anywhere in your crate.

```rs
#[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
#[allow(
clippy::all,
non_camel_case_types,
non_snake_case,
non_upper_case_globals
)]
pub mod target_module {
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
}
Expand Down Expand Up @@ -150,7 +155,12 @@ pyo3_bindgen = { version = "0.1", features = ["macros"] }
Then, you can call the `import_python!` macro anywhere in your crate.

```rs
#[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
#[allow(
clippy::all,
non_camel_case_types,
non_snake_case,
non_upper_case_globals
)]
pub mod target_module {
pyo3_bindgen::import_python!("target_module");
}
Expand Down
14 changes: 12 additions & 2 deletions pyo3_bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
//! Afterwards, include the generated bindings anywhere in your crate.
//!
//! ```rs
//! #[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
//! #[allow(
//! clippy::all,
//! non_camel_case_types,
//! non_snake_case,
//! non_upper_case_globals
//! )]
//! pub mod target_module {
//! include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
//! }
Expand Down Expand Up @@ -67,7 +72,12 @@
//! Then, you can call the `import_python!` macro anywhere in your crate.
//!
//! ```rs
//! #[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
//! #[allow(
//! clippy::all,
//! non_camel_case_types,
//! non_snake_case,
//! non_upper_case_globals
//! )]
//! pub mod target_module {
//! pyo3_bindgen::import_python!("target_module");
//! }
Expand Down
7 changes: 6 additions & 1 deletion pyo3_bindgen_engine/src/build_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
/// ```ignore
/// // src/lib.rs
///
/// #[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
/// #[allow(
/// clippy::all,
/// non_camel_case_types,
/// non_snake_case,
/// non_upper_case_globals
/// )]
/// pub mod os {
/// include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
/// }
Expand Down
14 changes: 12 additions & 2 deletions pyo3_bindgen_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@ mod parser;
/// // use pyo3_bindgen::import_python;
/// use pyo3_bindgen_macros::import_python;
///
/// #[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
/// #[allow(
/// clippy::all,
/// non_camel_case_types,
/// non_snake_case,
/// non_upper_case_globals
/// )]
/// pub mod sys {
/// import_python!("sys");
/// }
///
/// #[allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
/// #[allow(
/// clippy::all,
/// non_camel_case_types,
/// non_snake_case,
/// non_upper_case_globals
/// )]
/// pub(crate) mod os_path {
/// import_python!("os.path");
/// }
Expand Down

0 comments on commit a47ba4d

Please sign in to comment.