From 89e36625ed752476ff796e3f0052d486d61b20c3 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 8 Mar 2024 17:19:13 -0500 Subject: [PATCH 1/4] Add codespell to pre-commit Ref: https://github.com/readthedocs/readthedocs.org/pull/11195 --- pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pre-commit-config.yaml b/pre-commit-config.yaml index 0bee55c..986a032 100644 --- a/pre-commit-config.yaml +++ b/pre-commit-config.yaml @@ -71,3 +71,9 @@ repos: rev: v3.12.0 hooks: - id: vale + +- repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in setup.cfg + rev: v2.2.6 + hooks: + - id: codespell From caae9179ebbc83e98ddb4618543abe0e26c3970a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 8 Mar 2024 18:02:02 -0500 Subject: [PATCH 2/4] We need to explicitely exclude locale/ in pre-commit for codespell due to codespell bug ref: https://github.com/codespell-project/codespell/issues/3196 --- pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pre-commit-config.yaml b/pre-commit-config.yaml index 986a032..e5fffe1 100644 --- a/pre-commit-config.yaml +++ b/pre-commit-config.yaml @@ -77,3 +77,7 @@ repos: rev: v2.2.6 hooks: - id: codespell + exclude: | + (?x)^( + .*/locale/.* + )$ From d9ab13f11bb9a6767b4e3a3b6feeaeb2db5faedc Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 24 Jul 2025 10:42:58 -0400 Subject: [PATCH 3/4] boost codespell version --- pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre-commit-config.yaml b/pre-commit-config.yaml index e5fffe1..ba1b834 100644 --- a/pre-commit-config.yaml +++ b/pre-commit-config.yaml @@ -74,7 +74,7 @@ repos: - repo: https://github.com/codespell-project/codespell # Configuration for codespell is in setup.cfg - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell exclude: | From f3a42e36af9092796375aec90740c282d79e71b8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 24 Jul 2025 14:05:08 -0400 Subject: [PATCH 4/4] Adjust formatting + enable --write-changes for codespell in pre-commit --- pre-commit-config.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pre-commit-config.yaml b/pre-commit-config.yaml index ba1b834..9b74bcd 100644 --- a/pre-commit-config.yaml +++ b/pre-commit-config.yaml @@ -76,8 +76,9 @@ repos: # Configuration for codespell is in setup.cfg rev: v2.4.1 hooks: - - id: codespell - exclude: | - (?x)^( - .*/locale/.* - )$ + - id: codespell + args: [ --write-changes ] + exclude: | + (?x)^( + .*/locale/.* + )$