From 489dc2804ad972f306eda3c9b88c3ac352e97bd7 Mon Sep 17 00:00:00 2001
From: jakkdl
Date: Wed, 12 Jul 2023 14:14:59 +0200
Subject: [PATCH] add codespell to CI
---
check.sh | 2 ++
pyproject.toml | 3 +++
test-requirements.in | 1 +
test-requirements.txt | 2 ++
trio/_tests/test_exports.py | 2 +-
5 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/check.sh b/check.sh
index 8912f709e7..a0efa531b6 100755
--- a/check.sh
+++ b/check.sh
@@ -41,6 +41,8 @@ if git status --porcelain | grep -q "requirements.txt"; then
EXIT_STATUS=1
fi
+codespell || EXIT_STATUS=$?
+
python trio/_tests/check_type_completeness.py --overwrite-file || EXIT_STATUS=$?
if git status --porcelain trio/_tests/verify_types.json | grep -q "M"; then
echo "Type completeness changed, please update!"
diff --git a/pyproject.toml b/pyproject.toml
index 0f95a0cbc1..4b7dc39786 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,9 @@
[tool.black]
target-version = ['py37']
+[tool.codespell]
+ignore-words-list = 'astroid,crasher,asend'
+
[tool.flake8]
extend-ignore = ['D', 'E', 'W', 'F403', 'F405', 'F821', 'F822']
per-file-ignores = [
diff --git a/test-requirements.in b/test-requirements.in
index 1e1e23c2b8..14bfdcdf0b 100644
--- a/test-requirements.in
+++ b/test-requirements.in
@@ -19,6 +19,7 @@ flake8 < 6.0.0 # 6.0.0 drops python 3.7
flake8-pyproject
astor # code generation
pip-tools >= 6.13.0
+codespell
# https://github.com/python-trio/trio/pull/654#issuecomment-420518745
# typed_ast is deprecated as of 3.8, and straight up doesn't compile on 3.10-dev as of 2021-12-13
diff --git a/test-requirements.txt b/test-requirements.txt
index 6babde688e..7cb81d75a2 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -26,6 +26,8 @@ click==8.1.3
# via
# black
# pip-tools
+codespell==2.2.5
+ # via -r test-requirements.in
coverage==7.2.7
# via -r test-requirements.in
cryptography==39.0.2
diff --git a/trio/_tests/test_exports.py b/trio/_tests/test_exports.py
index 3ab0016386..b55df9937f 100644
--- a/trio/_tests/test_exports.py
+++ b/trio/_tests/test_exports.py
@@ -175,7 +175,7 @@ def no_underscores(symbols):
if modname == "trio":
static_names.add("testing")
- # these are hidden behind `if sys.plaftorm != "win32" or not TYPE_CHECKING`
+ # these are hidden behind `if sys.platform != "win32" or not TYPE_CHECKING`
# so presumably pyright is parsing that if statement, in which case we don't
# care about them being missing.
if modname == "trio.socket" and sys.platform == "win32":