From 1a85eac01ba7ba6379ed26c52a228b9ed04d3b46 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 4 Apr 2024 15:31:31 +1100 Subject: [PATCH 1/2] Move nightly_version file to crate root The nightly pinning is used by a bunch of different tools outside of github actions, move the config file to the crate root. Update the path in the justfile. Done in preparation for fixing the git pre-commit hook. --- .github/workflows/rust.yml | 2 +- justfile | 4 ++-- .github/nightly-version => nightly-version | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename .github/nightly-version => nightly-version (100%) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 169e2e5f..8837d8fc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Read nightly version id: read_toolchain - run: echo "nightly_version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT + run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT - name: Prepare tests id: get_matrix run: contrib/get_matrix.sh diff --git a/justfile b/justfile index ea776e81..b73a6820 100644 --- a/justfile +++ b/justfile @@ -11,11 +11,11 @@ check: # Lint everything. lint: - cargo +$(cat .github/nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings + cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings # Check the formatting format: - cargo +$(cat .github/nightly-version) fmt --all --check + cargo +$(cat ./nightly-version) fmt --all --check # Quick and dirty CI useful for pre-push checks. sane: lint diff --git a/.github/nightly-version b/nightly-version similarity index 100% rename from .github/nightly-version rename to nightly-version From 398fc6b73a178d2d5bee2ad56d3156411825b3a4 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 4 Apr 2024 15:26:22 +1100 Subject: [PATCH 2/2] Update pre-commit hook to use pinned nightly Use the pinned nightly toolchain from `./nightly-version` when running git pre-commit hook. --- githooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/githooks/pre-commit b/githooks/pre-commit index 90abae3c..5d0b9fe6 100755 --- a/githooks/pre-commit +++ b/githooks/pre-commit @@ -46,4 +46,4 @@ fi git diff-index --check --cached $against -- || exit 1 # Check that code lints cleanly. -cargo +nightly clippy --all-features -- -D warnings || exit 1 +cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings || exit 1