-
Notifications
You must be signed in to change notification settings - Fork 122
Integrate codespell into CI process. #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Initial investigations... Looking at https://pre-commit.com/ e.g. https://github.com/ioos/ioos-python-package-skeleton/blob/12fbcaeed97bd33a9d4ba997a4809080933017d2/.pre-commit-config.yaml#L56 where they have:
From
|
What am I doing wrong with codespell?
And with -L
|
This is where I'm at that doesn't totally work
repos:
- repo: https://github.com/codespell-project/codespell
rev: v1.17.1
hooks:
- id: codespell
args:
- --quiet-level=2
- --ignore-words .ignore_words.txt diff --git a/requirements-dev.txt b/requirements-dev.txt
index fe757be..e0289d8 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,10 +1,12 @@
+coverage==5.2.*
+distlib
+flake8==3.8.*
jsonschema==3.2.0
+nbsphinx==0.4.3
+pre-commit
pylint==1.9.1
Sphinx==1.8.0
sphinx-autobuild==0.7.1
sphinxcontrib-fulltoc==1.2.0
sphinxcontrib-napoleon==0.7
-flake8==3.8.*
yapf==0.28.*
-nbsphinx==0.4.3
-coverage==5.2.* Trying it out: pip install --upgrade -r requirements-dev.txt .
pre-commit install
pre-commit run --all-files Without
|
Note that I only added pre-commit and distlib to the |
@schwehr the current approach to the repo is to have linting and tests contained in the test script which is executed by the CI GitHub Action. I think it'd be better to keep to this workflow rather than introduce a pre-commit hook. So the steps as I see them are:
And then it will be picked up by CI automatically. This seems to work for me fo the ignore file:
where |
This PR adds running codespell to the scripts/test script, which is run by CI. This will fail PRs that have spelling mistakes. A currently empty ignore file is put into place in case codespell fails on any intentional spellings. Fixes #200
I, for one, am an admittedly horrible speller. My editor doesn't have spell check and I'm constantly letting bad spellings through.
One option to combat this for myself and others is to implement a
codespell
check on all *.rst, *.md and *.py files in the project. Codespell has an interactive mode and an ignore dictionary, so we could commit the ignore dict if there's any intentional spellings that block CI from passing.The text was updated successfully, but these errors were encountered: