diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb539698d65..d893f3768dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: toolchain: stable profile: minimal components: clippy - - run: nox -s clippy + - run: nox -s clippy -- --allow=clippy::borrow_deref_ref --allow=clippy::let_unit_value --allow=clippy::derive-partial-eq-without-eq check-target: needs: [fmt] diff --git a/noxfile.py b/noxfile.py index 216bc56d57e..5c72d08989c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -55,6 +55,7 @@ def clippy(session: nox.Session) -> None: "--workspace", "--", "--deny=warnings", + *session.posargs, external=True, ) diff --git a/pyo3-macros-backend/src/proto_method.rs b/pyo3-macros-backend/src/proto_method.rs index 648a9734258..c7c7fa6fdd5 100644 --- a/pyo3-macros-backend/src/proto_method.rs +++ b/pyo3-macros-backend/src/proto_method.rs @@ -125,7 +125,7 @@ fn insert_lifetime(ty: &mut syn::Type) { match ty { syn::Type::Reference(ref mut r) => { r.lifetime.get_or_insert(syn::parse_quote! {'p}); - insert_lifetime(&mut *r.elem); + insert_lifetime(&mut r.elem); } syn::Type::Path(ref mut path) => insert_lifetime_for_path(path), _ => {} diff --git a/src/gil.rs b/src/gil.rs index 8d4060085b8..4c640fc25d5 100644 --- a/src/gil.rs +++ b/src/gil.rs @@ -740,7 +740,7 @@ mod tests { let obj: Arc> = Arc::new(get_object(py)); let thread_obj = Arc::clone(&obj); - let count = (&*obj).get_refcnt(py); + let count = obj.get_refcnt(py); println!( "1: The object has been created and its reference count is {}", count diff --git a/src/pyclass.rs b/src/pyclass.rs index eb2bb5c9595..9144bf3af87 100644 --- a/src/pyclass.rs +++ b/src/pyclass.rs @@ -1,3 +1,4 @@ +#![allow(clippy::type_complexity)] //! `PyClass` and related traits. use crate::{ callback::IntoPyCallbackOutput, diff --git a/src/type_object.rs b/src/type_object.rs index b8c2d654133..0fa40eace0e 100644 --- a/src/type_object.rs +++ b/src/type_object.rs @@ -1,3 +1,4 @@ +#![allow(clippy::type_complexity)] // Copyright (c) 2017-present PyO3 Project and Contributors //! Python type object information