Rust project template for Copier.
- Create a new project -
copier copy gh:ahcodedev/rust-template path/to/new-project - Pull in template updates from inside a generated project -
just update-template(runscopier update)
- Install
just-brew install just - Install Copier, rustup, tombi, actionlint, zizmor, prek and gitleaks with Homebrew, then cargo-binstall and the pinned Rust tools (cargo-deny, cargo-nextest, cargo-shear, cargo-llvm-cov, typos) with cargo -
just setup- Change tool versions in
cargo_toolsat the top of thejustfile; reinstall withjust install-tools - Bump them all to the latest releases and install them -
just update-cargo-tools
- Change tool versions in
- Enable the Git hooks in
prek.toml-prek install- Before each commit they run
just lintand scan the staged changes for secrets with gitleaks
- Before each commit they run
Commands are defined in the justfile and run with just.
- List available commands -
just - Format TOML files with tombi -
just fmt - Check spelling with typos, TOML formatting with tombi, and GitHub Actions workflows with actionlint and zizmor -
just lint - Render the template into a temp directory, then lint, test, check coverage and check dependencies of the generated project -
just test-template - Scan the Git history for committed secrets -
just gitleaks
CI runs just lint and just test-template, scans the Git history for secrets with gitleaks, and audits the workflows with zizmor-action.
- zizmor-action reports findings as code scanning alerts in the repository's Security tab rather than failing CI
- Code scanning needs a public repo, or GitHub Advanced Security on a private one
- Dependabot (
.github/dependabot.yml) opens weekly PRs for GitHub Actions in this repo's workflows and intemplate/- Updates wait 7 days after a release before a PR is opened
- Patch and minor updates are auto-merged once CI passes (
.github/workflows/dependabot-auto-merge.yml); major updates wait for review- Auto-merge needs "Allow auto-merge" turned on in the repository settings and a branch protection rule or ruleset on
mainthat requires the CI checks - On GitHub Free, branch protection and auto-merge are only available for public repos
- Auto-merge needs "Allow auto-merge" turned on in the repository settings and a branch protection rule or ruleset on
- Dependabot doesn't update the actionlint version in the workflows and dev container, the gitleaks version and image in the dev container, or anything in
.jinjafiles
copier.yml- template questions and settingstemplate/- files rendered into new projects; files ending in.jinjaare templatedprek.toml- Git hooks for this repo.github/pull_request_template.md- checklist filled into new PR descriptions