From 20b80c86645ffda946b63f142cecfa772cbfac8f Mon Sep 17 00:00:00 2001 From: konstantin Date: Tue, 2 Jan 2024 08:42:47 +0100 Subject: [PATCH] Add CI Action with Spell Check Add ignore list for spell-checker --- dev_requirements/requirements-spell_check.in | 1 + dev_requirements/requirements-spell_check.txt | 8 ++++++++ domain-specific-terms.txt | 11 +++++++++++ tox.ini | 12 ++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 dev_requirements/requirements-spell_check.in create mode 100644 dev_requirements/requirements-spell_check.txt create mode 100644 domain-specific-terms.txt diff --git a/dev_requirements/requirements-spell_check.in b/dev_requirements/requirements-spell_check.in new file mode 100644 index 0000000..e3da9e4 --- /dev/null +++ b/dev_requirements/requirements-spell_check.in @@ -0,0 +1 @@ +codespell diff --git a/dev_requirements/requirements-spell_check.txt b/dev_requirements/requirements-spell_check.txt new file mode 100644 index 0000000..97d86a4 --- /dev/null +++ b/dev_requirements/requirements-spell_check.txt @@ -0,0 +1,8 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile requirements-spellcheck.in +# +codespell==2.2.6 + # via -r dev_requirements/requirements-spell_check.in diff --git a/domain-specific-terms.txt b/domain-specific-terms.txt new file mode 100644 index 0000000..c94f1a9 --- /dev/null +++ b/domain-specific-terms.txt @@ -0,0 +1,11 @@ +bdew +alle +tage +oder +generell +frist +als +beginn +ist +tages +vor \ No newline at end of file diff --git a/tox.ini b/tox.ini index 37d9bbf..096cfca 100644 --- a/tox.ini +++ b/tox.ini @@ -67,3 +67,15 @@ deps = commands = python -m build twine check dist/* + +[testenv:spell_check] +# the spellcheck environment checks the code for typos +setenv = PYTHONPATH = {toxinidir}/src +deps = + -r requirements.txt + -r dev_requirements/requirements-spell_check.txt +commands = + codespell --ignore-words=domain-specific-terms.txt src/bdew_datetimes + codespell --ignore-words=domain-specific-terms.txt README.md + # add single files (ending with .py) or packages here + # note that domain-specific-terms.txt (the ignore list of the spell checker) has to contain the ignored words in all lower case \ No newline at end of file