diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b3a2a6ec3..2cdae5c4d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -80,7 +80,7 @@ repos: - id: clippy name: clippy (workspace strict) description: Strict clippy on entire workspace - deny all warnings - entry: cargo clippy --workspace --all-features --all-targets -- -D warnings + entry: python3 contrib/run_clippy.py language: system types: [rust] pass_filenames: false diff --git a/contrib/run_clippy.py b/contrib/run_clippy.py new file mode 100755 index 000000000..9b3448896 --- /dev/null +++ b/contrib/run_clippy.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Run clippy.""" + +import subprocess +import sys + +cmd = [ + "cargo", "clippy", + "--workspace", + "--all-features", + "--all-targets", +] + +# Exclude dash-fuzz on Windows (honggfuzz doesn't support Windows) +if sys.platform == "win32": + cmd.extend(["--exclude", "dash-fuzz"]) + +cmd.extend(["--", "-D", "warnings"]) + +sys.exit(subprocess.call(cmd))