From fc5719b2453b07532b82543fe19fe068dd93d893 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Tue, 21 Dec 2021 16:57:55 +0100 Subject: [PATCH 1/2] Add cargo udeps --- .pre-commit-config.yaml | 7 +++++++ .taskcluster.yml | 2 ++ 2 files changed, 9 insertions(+) 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} && From 80a14baba3c4a3a18bcf05c7a8e63b8926c1bd48 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Tue, 21 Dec 2021 23:45:24 +0100 Subject: [PATCH 2/2] Ignore useless deps used to recreate grammar automatically --- tree-sitter-mozcpp/Cargo.toml | 3 +++ tree-sitter-mozjs/Cargo.toml | 3 +++ 2 files changed, 6 insertions(+) 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"]