From 0e5eb500ca378e2bb9b9b65fd7fe29f03dfb706f Mon Sep 17 00:00:00 2001 From: mulhern Date: Tue, 2 Jan 2024 21:42:51 -0500 Subject: [PATCH] Makefile: Add CLIPPY_FIX variable This allows clippy to be optionally called with --fix flag set. Signed-off-by: mulhern --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d6bb689..1a426f9 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,12 @@ else FEDORA_RELEASE_ARGS = --release=${FEDORA_RELEASE} endif +ifeq ($(origin CLIPPY_FIX), undefined) + CLIPPY_OPTS = --all-targets --no-deps +else + CLIPPY_OPTS = --fix +endif + IGNORE_ARGS ?= DENY = -D warnings -D future-incompatible -D unused -D rust_2018_idioms -D nonstandard_style @@ -51,13 +57,13 @@ check-fedora-versions: test-compare-fedora-versions clippy: RUSTFLAGS="${DENY}" \ - cargo clippy --all-targets --all-features -- \ + cargo clippy --all-features ${CLIPPY_OPTS} -- \ -D warnings \ -D clippy::cargo \ -D clippy::all \ -A clippy::from_over_into (cd libblkid-rs-sys && RUSTFLAGS="${DENY}" \ - cargo clippy --all-targets --all-features -- \ + cargo clippy --all-features ${CLIPPY_OPTS} -- \ -D warnings \ -D clippy::cargo \ -D clippy::all)