From ad35adbfa17481ca6675998652fa3c6c6fae9ef3 Mon Sep 17 00:00:00 2001 From: Laurent Sorber Date: Wed, 24 Dec 2025 10:58:20 +0000 Subject: [PATCH] feat: add codespell linter --- template/.pre-commit-config.yaml.jinja | 6 ++++++ template/pyproject.toml.jinja | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/template/.pre-commit-config.yaml.jinja b/template/.pre-commit-config.yaml.jinja index 2d1bb1a..e2073d2 100644 --- a/template/.pre-commit-config.yaml.jinja +++ b/template/.pre-commit-config.yaml.jinja @@ -70,6 +70,12 @@ repos: require_serial: true language: system types_or: [python, pyi] + - id: codespell + name: codespell + entry: codespell . + require_serial: true + language: system + types_or: [markdown, python, pyi, toml, yaml] - id: ruff-format name: ruff format entry: ruff format diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 40ce448..f6918f6 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -41,6 +41,7 @@ issues = "{{ project_url.rstrip('/') }}/{% if ci == 'gitlab' %}-/{% endif %}issu [dependency-groups] # https://docs.astral.sh/uv/concepts/projects/dependencies/#development-dependencies dev = [ + "codespell (>=2.4.1)", {%- if with_conventional_commits %} "commitizen (>=4.3.0)", {%- endif %} @@ -63,6 +64,11 @@ dev = [ "typeguard (>=4.4.1)", {%- endif %} ] + +[tool.codespell] # https://github.com/codespell-project/codespell +builtin = "en-GB_to_en-US,clear,code,rare" +check-filenames = true +skip = "./*_cache/,./.venv,./reports" {%- if with_conventional_commits %} [tool.commitizen] # https://commitizen-tools.github.io/commitizen/config/