From 775326790e776af00cde10e9adcba8c2db82a568 Mon Sep 17 00:00:00 2001 From: konstin Date: Tue, 6 Jun 2023 08:06:48 +0200 Subject: [PATCH] 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 --- .pre-commit-config.yaml | 10 +++++++++- _typos.toml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf2933368a..572edd2781 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/_typos.toml b/_typos.toml index 8f5f834f9b..778ba59eaf 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,5 +1,5 @@ [files] -extend-exclude = ["snapshots", "black"] +extend-exclude = ["resources", "snapshots"] [default.extend-words] trivias = "trivias"