typos/docs/pre-commit.md
Ed Page 4ba8712927
Some checks are pending
Security audit / security_audit (push) Waiting to run
Security audit / cargo_deny (bans licenses sources) (push) Waiting to run
CI / CI (push) Blocked by required conditions
CI / Test (push) Waiting to run
CI / Check MSRV (push) Waiting to run
CI / lockfile (push) Waiting to run
CI / Docs (push) Waiting to run
CI / rustfmt (push) Waiting to run
CI / clippy (push) Waiting to run
CI / Coverage (push) Waiting to run
/ linux (aarch64) (push) Waiting to run
/ linux (x86) (push) Waiting to run
/ linux (x86_64) (push) Waiting to run
/ musllinux (aarch64) (push) Waiting to run
/ musllinux (x86_64) (push) Waiting to run
/ windows (x64) (push) Waiting to run
/ windows (x86) (push) Waiting to run
/ macos (aarch64) (push) Waiting to run
/ macos (x86_64) (push) Waiting to run
/ sdist (push) Waiting to run
/ Release (push) Blocked by required conditions
pre-commit / pre-commit (push) Waiting to run
chore: Release
2024-10-24 10:57:19 -05:00

26 lines
839 B
Markdown

# pre-commit
To use `typos` with [`pre-commit`](https://pre-commit.com), point its
config at this repository:
```yaml
repos:
- repo: https://github.com/crate-ci/typos
rev: v1.26.3
hooks:
- id: typos
```
The `typos` id installs a prebuilt executable from GitHub releases. If
one does not exist for the target platform, or if one built from
sources is preferred, use `typos-docker` (requires Docker), or `typos-src`
(requires Rust) as the hook id instead.
Be sure to change `rev` to use the desired `typos` git tag or
revision.
The hook configuration defaults to writing fixes, which triggers a
`pre-commit` failure if any files are modified. To make it report its
findings only instead, override the hook's `args` with something that
does not contain `-w`/`--write-changes`, for example `[]` (meaning
pass no options).