From 72475a385e78c726d903020788037c8f0044d6fd Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" <69792125+mayeul-zama@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:05:22 +0200 Subject: [PATCH] chore(all): add makefile command to clippy lint doctests - The command exits with a warning on windows as it does not work at the moment --- Makefile | 11 +++++++++++ scripts/clippy_driver.sh | 5 +++++ 2 files changed, 16 insertions(+) create mode 100755 scripts/clippy_driver.sh diff --git a/Makefile b/Makefile index 74d045a11..6d318d491 100644 --- a/Makefile +++ b/Makefile @@ -266,6 +266,17 @@ clippy: install_rs_check_toolchain --features=$(TARGET_ARCH_FEATURE),boolean,shortint,integer \ -p $(TFHE_SPEC) -- --no-deps -D warnings +.PHONY: clippy_rustdoc # Run clippy lints on doctests enabling the boolean, shortint, integer and zk-pok +clippy_rustdoc: install_rs_check_toolchain + if [[ "$(OS)" != "Linux" && "$(OS)" != "Darwin" ]]; then \ + echo "WARNING: skipped clippy_rustdoc, unsupported OS $(OS)"; \ + exit 0; \ + fi && \ + CLIPPYFLAGS="-D warnings" RUSTDOCFLAGS="--no-run --nocapture --test-builder ./scripts/clippy_driver.sh -Z unstable-options" \ + cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" test --doc \ + --features=$(TARGET_ARCH_FEATURE),boolean,shortint,integer,zk-pok,pbs-stats \ + -p $(TFHE_SPEC) + .PHONY: clippy_c_api # Run clippy lints enabling the boolean, shortint and the C API clippy_c_api: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ diff --git a/scripts/clippy_driver.sh b/scripts/clippy_driver.sh new file mode 100755 index 000000000..34bc4b5e0 --- /dev/null +++ b/scripts/clippy_driver.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -eu + +exec clippy-driver ${CLIPPYFLAGS} $@