From 4bd7e072cef830ba792a6672b8758713adad21b5 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 15 Jun 2026 16:44:47 -0700 Subject: [PATCH 1/2] feat: Add pre-commit hooks These can be enabled by running `git config core.hooksPath .githooks`. We don't want icky commits. --- .githooks/pre-commit | 14 ++++++++++++++ .justfile | 7 +++++++ CONTRIBUTING.md | 2 ++ 3 files changed, 23 insertions(+) create mode 100755 .githooks/pre-commit diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..d19258f --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,14 @@ +#!/bin/sh +# SPDX-License-Identifier: MIT OR Apache-2.0 + +set -e + +# just test +cargo --locked nextest run --all-features --workspace +cargo test --doc --all-features --workspace + +# just lint +taplo format --check +taplo lint +cargo fmt --all --check +cargo clippy --workspace --examples --tests --benches --all-features --all-targets --locked diff --git a/.justfile b/.justfile index b8e56c7..06dada0 100644 --- a/.justfile +++ b/.justfile @@ -40,6 +40,9 @@ lints: toml-check-fmt toml-lint check-fmt clippy # Rust all tests test: unit-test doctest +# Run all code-quality checks +precommit: test lints + # Publish crate to crates.io publish: cargo publish --token $CARGO_REGISTRY_TOKEN @@ -51,3 +54,7 @@ audit: # Check GitHub Actions security analysis with `zizmor` check-github-actions-security: zizmor . + +# Performs one-time repo setup +setup: + git config core.hooksPath .githooks diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be0da2f..bb2ecd5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,3 +80,5 @@ you can run the basic CI checks in your local environment: modern test runner for Rust. - [`cargo-audit`](https://docs.rs/cargo-audit/latest/cargo_audit/): tool to check `Cargo.lock` files for security vulnerabilities. + +Please do `git config core.hooksPath .githooks` to automatically run these tools on each commit. From 87e69fbecc72beb72e4213ca395e22401bb026ef Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 15 Jun 2026 16:44:55 -0700 Subject: [PATCH 2/2] fix: Mention URLs in deployment instructions - Tell the user to search for "rust-template" as part of their deployment. - Fix errant URL to include the "rust-template" search term. --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 02b4b81..b49c065 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -51,7 +51,7 @@ body: id: terms attributes: label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/alpenlabs/bitcoind-async-client/blob/main/CONTRIBUTING.md#code-of-conduct) + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/alpenlabs/rust-template/blob/main/CONTRIBUTING.md#code-of-conduct) # CHANGEME options: - label: I agree to follow the Code of Conduct required: true diff --git a/README.md b/README.md index 57d5215..398cad8 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ hardened with [`zizmor`](https://docs.zizmor.sh). and it will be automatically triggered by CI on every new tag release. You just need to add a crates.io token to the `CARGO_REGISTRY_TOKEN` repository secret variable. -This template has a lot of `CHANGEME` placeholders that you should replace with your own values. -Please do a repository-wide search and replace all occurrences of `CHANGEME` with your own values. +This template has a lot of `CHANGEME` placeholders that you should replace with your own values, as well as URLs pointing to the `rust-template` project. +Please do a repository-wide search and replace all occurrences of `CHANGEME` and `rust-template` with your own values. ## Settings and Branch Protection Rules