From 2a1118eac8fda95551515d474c820a83f2cc4a66 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 13:50:43 -0400 Subject: [PATCH 1/2] style: move codespell configuration to pyproject.toml So people could just run "codespell" without pre-commit and have centralized configuration for tools (the others are already in pyproject.toml) Signed-off-by: Yaroslav Halchenko --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 301797800..d9e9ef4d4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,10 +41,10 @@ repos: hooks: - id: codespell name: Run codespell to check for common misspellings in files + # config section is within pyproject.toml language: python types: [ text ] - args: [ "--write-changes", "--ignore-words-list", "asend" ] - exclude: "poetry.lock" + args: [ "--write-changes" ] - repo: https://github.com/commitizen-tools/commitizen rev: v3.26.2 # automatically updated by Commitizen diff --git a/pyproject.toml b/pyproject.toml index 22eece6bc..d85102191 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -174,3 +174,9 @@ warn_unused_configs = true [[tool.mypy.overrides]] module = "py.*" # Legacy pytest dependencies ignore_missing_imports = true + +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*,*.svg,*.lock' +check-hidden = true +ignore-words-list = 'asend' From fd659826af26577d8a30715d040c6373cf9732f4 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 22 May 2024 11:58:11 -0400 Subject: [PATCH 2/2] ci: add tomli as additional dependency for codespell since config now is in pyproject.toml Signed-off-by: Yaroslav Halchenko --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9e9ef4d4..1d7b798ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,6 +45,8 @@ repos: language: python types: [ text ] args: [ "--write-changes" ] + additional_dependencies: + - tomli - repo: https://github.com/commitizen-tools/commitizen rev: v3.26.2 # automatically updated by Commitizen