Skip to content

Commit

Permalink
Adding Codespell to the CI (open-telemetry#2878)
Browse files Browse the repository at this point in the history
  • Loading branch information
galbash authored Aug 17, 2022
1 parent edb1391 commit cd2b6a9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
# skipping auto generated folders
skip = ./.tox,./.mypy_cache,./docs/_build,./target
ignore-words-list = ans,ue,ot,hist
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tox-environment: [ "docker-tests", "lint", "docs", "mypy", "mypyinstalled", "tracecontext" ]
tox-environment: [ "docker-tests", "lint", "spellcheck", "docs", "mypy", "mypyinstalled", "tracecontext" ]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-20.04
steps:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ You can run `tox` with the following arguments:
- `tox -e opentelemetry-api` and `tox -e opentelemetry-sdk` to run the API and SDK unit tests
- `tox -e py37-opentelemetry-api` to e.g. run the API unit tests under a specific
Python version
- `tox -e spellcheck` to run a spellcheck on all the code
- `tox -e lint` to run lint checks on all code

`black` and `isort` are executed when `tox -e lint` is run. The reported errors can be tedious to fix manually.
Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ protobuf~=3.18.1
# breaking change introduced in markupsafe causes jinja, flask to break
markupsafe==2.0.1
bleach==4.1.0 # This dependency was updated to a breaking version.
codespell==2.1.0
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ envlist =
pypy3-opentelemetry-propagator-jaeger

lint
spellcheck
tracecontext
mypy,mypyinstalled
docs
Expand Down Expand Up @@ -180,6 +181,15 @@ commands =
; implicit Any due to unfollowed import would result).
mypyinstalled: mypy --install-types --non-interactive --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict

[testenv:spellcheck]
basepython: python3.9
recreate = True
deps =
codespell

commands =
codespell

[testenv:lint]
basepython: python3.9
recreate = True
Expand Down

0 comments on commit cd2b6a9

Please sign in to comment.