diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0fe204ac..45be3aa1c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,6 +28,13 @@ repos: entry: cargo clippy --all-targets --all -- -D warnings pass_filenames: false + - id: udeps + name: udeps + language: system + files: '\.rs$' + entry: cargo +nightly udeps --all-targets + pass_filenames: false + - id: test name: test language: system diff --git a/.taskcluster.yml b/.taskcluster.yml index fdcd11930..84401c7ec 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -41,6 +41,8 @@ tasks: - "-cx" - "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && rustup component add clippy rustfmt && + rustup toolchain install nightly && + curl -L https://github.com/est31/cargo-udeps/releases/download/v0.1.25/cargo-udeps-v0.1.25-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /usr/local/cargo/bin --strip-components 2 && git clone --quiet ${repository} && cd rust-code-analysis && git -c advice.detachedHead=false checkout ${head_rev} && diff --git a/tree-sitter-mozcpp/Cargo.toml b/tree-sitter-mozcpp/Cargo.toml index 1c603b6cc..f3e06abb6 100644 --- a/tree-sitter-mozcpp/Cargo.toml +++ b/tree-sitter-mozcpp/Cargo.toml @@ -28,3 +28,6 @@ cc = "^1.0" # This dependency is not used at all for this crate, but it is here so that # dependabot can send notifications when there are updates for this grammar tree-sitter-cpp = "0.19.0" + +[package.metadata.cargo-udeps.ignore] +build = ["tree-sitter-cpp"] diff --git a/tree-sitter-mozjs/Cargo.toml b/tree-sitter-mozjs/Cargo.toml index ab98eb9c5..9a93ecb4a 100644 --- a/tree-sitter-mozjs/Cargo.toml +++ b/tree-sitter-mozjs/Cargo.toml @@ -28,3 +28,6 @@ cc = "^1.0" # This dependency is not used at all for this crate, but it is here so that # dependabot can send notifications when there are updates for this grammar tree-sitter-javascript = "0.19.0" + +[package.metadata.cargo-udeps.ignore] +build = ["tree-sitter-javascript"]