Fix pre-commit typos action (#4876)

The typos pre-commit action would also edit test fixtures and snapshots. Unfortunately the pre-commit action also doesn't respect _typos.toml and typos action doesn't allow for an exclude key, so i've added a top level exclude key. I have confirmed that this does stop typos from rewriting my fixtures and snapshots
This commit is contained in:
konstin 2023-06-06 08:06:48 +02:00 committed by GitHub
parent 7b0fb1a3b4
commit 775326790e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -1,4 +1,12 @@
fail_fast: true
exclude: |
(?x)^(
crates/ruff/resources/.*|
crates/ruff_python_formatter/resources/.*|
crates/ruff_python_formatter/src/snapshots/.*
)$
repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.1
@ -19,7 +27,7 @@ repos:
- id: markdownlint-fix
- repo: https://github.com/crate-ci/typos
rev: v1.14.8
rev: v1.14.12
hooks:
- id: typos

View file

@ -1,5 +1,5 @@
[files]
extend-exclude = ["snapshots", "black"]
extend-exclude = ["resources", "snapshots"]
[default.extend-words]
trivias = "trivias"