From fb03dd977e277048c396d9285c20db3cb55474ca Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 28 Feb 2024 06:01:49 -0500 Subject: [PATCH] Add codespell: config + workflow to detect new typos. Get some typos fixed (#9234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Do not ignore .codespellrc from git * Add rudimentary codespell config * Add pre-commit definition for codespell * more custom skips for codespell - long lines, lines with รบ etc * [DATALAD RUNCMD] Do interactive fixing of some ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2 ./docs/community/release-notes.md", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * BF: pre-commit needs to duplicate some of the skips for codespell Known issue -- yet to be addressed: https://github.com/codespell-project/codespell/issues/3196 * Move codespell configuration into setup.cfg --- .pre-commit-config.yaml | 6 ++++++ docs/community/release-notes.md | 2 +- setup.cfg | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c37da7449..8939dd3db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,3 +25,9 @@ repos: exclude: ^(?!docs).*$ additional_dependencies: - black==23.1.0 +- repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .codespellrc + rev: v2.2.6 + hooks: + - id: codespell + exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md index 71f29e5c0..043c19879 100644 --- a/docs/community/release-notes.md +++ b/docs/community/release-notes.md @@ -946,7 +946,7 @@ See the [release announcement][3.6-release]. * description.py codes and tests removal. ([#4153][gh4153]) * Wrap guardian.VERSION in tuple. ([#4149][gh4149]) * Refine validator for fields with kwargs. ([#4146][gh4146]) -* Fix None values representation in childs of ListField, DictField. ([#4118][gh4118]) +* Fix None values representation in children of ListField, DictField. ([#4118][gh4118]) * Resolve TimeField representation for midnight value. ([#4107][gh4107]) * Set proper status code in AdminRenderer for the redirection after POST/DELETE requests. ([#4106][gh4106]) * TimeField render returns None instead of 00:00:00. ([#4105][gh4105]) diff --git a/setup.cfg b/setup.cfg index 487d99db9..e7e288816 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,3 +29,8 @@ include = rest_framework/*,tests/* exclude_lines = pragma: no cover raise NotImplementedError + +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = */kickstarter-announcement.md,*.js,*.map,*.po +ignore-words-list = fo,malcom,ser