ci,contrib: add typos and pre-commit script

This commit is contained in:
oxalica 2024-10-13 04:30:53 -04:00
parent ba9673065a
commit 1c9108610d
4 changed files with 9 additions and 1 deletions

View file

@ -37,6 +37,9 @@ jobs:
- name: Rustdoc
run: cargo doc --workspace --no-deps
- name: Typos
uses: crate-ci/typos@v1.26.0
test:
strategy:
fail-fast: false

0
.typos.toml Normal file
View file

View file

@ -38,7 +38,7 @@ impl IdExt for Id {
last_id.set(id);
Id(id)
} else {
// Otherwise, try to increse the trailing counter.
// Otherwise, try to increase the trailing counter.
assert!(prev < (1 << 16), "id counter overflow");
last_id.set(prev + 1);
Id(prev + 1)

5
contrib/pre-commit Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
typos
cargo fmt -- --check
fd -e nix | xargs nixfmt --check