From f5d5d2557a36b3a96dd40e547d7346d46b14675e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 31 Mar 2022 00:26:41 +0100 Subject: [PATCH] clippy: wip machinery, and transfer the one allowed lint so far Signed-off-by: Ian Jackson --- Makefile | 10 ++++++++++ base/lib.rs | 1 + clippy-options | 3 +++ src/lib.rs | 2 -- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 clippy-options diff --git a/Makefile b/Makefile index 29367ce7..0fec0179 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,10 @@ DEPLOY_TARGET_DIR=$(TARGET_DIR)/$(addsuffix /,$(DEPLOY_ARCH))$(DEPLOY_RELEASE) DEPLOYED_BRANCH=deployed PUBLISHED_BRANCH=published +RUST_CLIPPY_OPTIONS ?= $(shell perl -pe 's/\#.*//; s/\n/ /' clippy-options) +RUST_CLIPPY ?= clippy +RUST_CLIPPY_CMD := clippy $(RUST_CLIPPY_OPTIONS) + #---------- nailing-cargo ---------- ifneq (,$(wildcard ../Cargo.nail)) @@ -180,6 +184,12 @@ cargo-syntaxcheck-wasm: cargo-syntaxcheck-release: $(CARGO) check --workspace --release +cargo-clippy: cargo-clippy-host cargo-clippy-wasm +cargo-clippy-host: clippy-options + $(CARGO) $(RUST_CLIPPY) --workspace $(RUST_CLIPPY_OPTIONS) +cargo-clippy-wasm: clippy-options + $(CARGO) $(RUST_CLIPPY) --target $(WASM) -p otter-wasm $(RUST_CLIPPY_OPTIONS) + #---------- cargo ---------- DR=debug release diff --git a/base/lib.rs b/base/lib.rs index d4610694..7757111d 100644 --- a/base/lib.rs +++ b/base/lib.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // There is NO WARRANTY. +#![allow(clippy::redundant_closure_call)] pub mod imports; pub mod prelude; diff --git a/clippy-options b/clippy-options new file mode 100644 index 00000000..85048bf1 --- /dev/null +++ b/clippy-options @@ -0,0 +1,3 @@ +-- +-A clippy::redundant_closure_call +-A clippy::writeln_empty_string diff --git a/src/lib.rs b/src/lib.rs index 731f1020..50c0b4f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // There is NO WARRANTY. -#![allow(clippy::redundant_closure_call)] - pub mod imports; pub mod prelude; -- 2.30.2