mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-23 16:12:25 -05:00
9d89015957
Some checks failed
Security audit / security_audit (push) Has been cancelled
Security audit / cargo_deny (bans licenses sources) (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Check MSRV (push) Has been cancelled
CI / lockfile (push) Has been cancelled
CI / Docs (push) Has been cancelled
CI / rustfmt (push) Has been cancelled
CI / clippy (push) Has been cancelled
CI / Coverage (push) Has been cancelled
/ linux (aarch64) (push) Has been cancelled
/ linux (x86) (push) Has been cancelled
/ linux (x86_64) (push) Has been cancelled
/ musllinux (aarch64) (push) Has been cancelled
/ musllinux (x86_64) (push) Has been cancelled
/ windows (x64) (push) Has been cancelled
/ windows (x86) (push) Has been cancelled
/ macos (aarch64) (push) Has been cancelled
/ macos (x86_64) (push) Has been cancelled
/ sdist (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
CI / CI (push) Has been cancelled
/ Release (push) Has been cancelled
26 lines
839 B
Markdown
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.28.4
|
|
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).
|