From 26859357c5b3702c72706cce0fcd39d7c15bbc8b Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Mon, 3 Jun 2024 10:19:58 -0500 Subject: [PATCH] CI: Migrate codespell logic to `pyproject.toml` --- .pre-commit-config.yaml | 31 ++------------------------ pyproject.toml | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12240aef939..d09ecabe70c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,37 +35,10 @@ repos: types_or: [text] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell - types_or: [text] - exclude: | - (?x)^( - .*\.desktop$| - .*\.gitignore$| - .*\.po$| - .*\.pot$| - .*\.rc$| - \.mailmap$| - AUTHORS.md$| - COPYRIGHT.txt$| - DONORS.md$| - core/input/gamecontrollerdb.txt$| - core/string/locales.h$| - editor/project_converter_3_to_4.cpp$| - platform/android/java/lib/src/com/.*| - platform/web/package-lock.json$ - ) - args: - - --enable-colors - - --write-changes - - --check-hidden - - --quiet-level - - '3' - - --ignore-words-list - - aesthetic,aesthetics,breaked,cancelled,colour,curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,mis,nd,numer,ot,requestor,te,thirdparty,vai - - --builtin - - clear,rare,en-GB_to_en-US + additional_dependencies: [tomli] ### Requires Docker; look into alternative implementation. # - repo: https://github.com/comkieffer/pre-commit-xmllint.git diff --git a/pyproject.toml b/pyproject.toml index 34ae075f2ba..59b6d09a032 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,3 +27,51 @@ extend-select = [ "E402", # Module level import not at top of file "F821", # Undefined name ] + +[tool.codespell] +enable-colors = "" +write-changes = "" +check-hidden = "" +quiet-level = 3 +builtin = "clear,rare,en-GB_to_en-US" +skip = """\ + .mailmap, + *.desktop, + *.gitignore, + *.po, + *.pot, + *.rc, + AUTHORS.md, + COPYRIGHT.txt, + core/input/gamecontrollerdb.txt, + core/string/locales.h, + DONORS.md, + editor/project_converter_3_to_4.cpp, + platform/android/java/lib/src/com/*, + platform/web/package-lock.json +""" +ignore-words-list = """\ + breaked, + cancelled, + checkin, + colour, + curvelinear, + doubleclick, + expct, + findn, + gird, + hel, + inout, + labelin, + lod, + mis, + nd, + numer, + ot, + outin, + requestor, + te, + textin, + thirdparty, + vai +"""