Skip to content

Commit

Permalink
Fix pre-commit typos action (#4876)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
konstin authored Jun 6, 2023
1 parent 7b0fb1a commit 7753267
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[files]
extend-exclude = ["snapshots", "black"]
extend-exclude = ["resources", "snapshots"]

[default.extend-words]
trivias = "trivias"
Expand Down

0 comments on commit 7753267

Please sign in to comment.