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
This commit is contained in:
Mayeul@Zama
2024-06-21 18:05:22 +02:00
committed by Arthur Meyre
parent cc8f2cb4dc
commit 72475a385e
2 changed files with 16 additions and 0 deletions

View File

@@ -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 \

5
scripts/clippy_driver.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eu
exec clippy-driver ${CLIPPYFLAGS} $@