chiark / gitweb /
clippy: wip machinery, and transfer the one allowed lint so far
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 30 Mar 2022 23:26:41 +0000 (00:26 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 30 Mar 2022 23:28:42 +0000 (00:28 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
base/lib.rs
clippy-options [new file with mode: 0644]
src/lib.rs

index 29367ce7999d5f10e093143d7a9ad95601a74dc2..0fec0179f4bd0e938b7f07b1307c55b6f12bd1e8 100644 (file)
--- 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
index d4610694e6e32a4cf10bcefa01fc88e28d915489..7757111d3a59ecd3f6dfe5aae397075820a54915 100644 (file)
@@ -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 (file)
index 0000000..85048bf
--- /dev/null
@@ -0,0 +1,3 @@
+--
+-A clippy::redundant_closure_call
+-A clippy::writeln_empty_string
index 731f1020ababda560d93cb704c43d37c8d1f913a..50c0b4f3a929a4d64abbaff5e51a59a8955c7580 100644 (file)
@@ -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;