Skip to content

Commit

Permalink
Put codespell in pre-commit (#85)
Browse files Browse the repository at this point in the history
* Add pre-commit hook for codespell

* Move codespell configuration to pyproject.toml

* Try multi-line skip entry for codespell config

* Revert change

* Remove GitHub Action for codespell in favor of pre-commit
  • Loading branch information
namurphy authored Nov 23, 2022
1 parent 4085bbd commit 8edd466
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
python: '3.11'
noxenv: linters

- name: Import package
noxenv: import_package

steps:

- name: Checkout code
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ repos:
hooks:
- id: absolufy-imports
exclude: docs/plasmapy_sphinx

- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
args: [--config pyproject.toml]
6 changes: 0 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ def linters(session):
session.run("flake8", "xrtpy", *flake8_options, *session.posargs)


@nox.session
def codespell(session):
session.install("codespell")
session.run("codespell", ".")


@nox.session
def import_package(session):
session.install(".")
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ requires = ["setuptools >= 50.0",
"wheel >= 0.34.0"] # ought to mirror 'requirements/build.txt'
build-backend = "setuptools.build_meta"

[tool.codespell]
skip = "*.genx,*.geny,*.png,*egg*,.git,.hypothesis,.nox,.tox,.idea,__pycache__,_build"
ignore-words-list = """
circularly"""

[tool.gilesbot]

[tool.gilesbot.pull_requests]
Expand Down
9 changes: 0 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,3 @@ exclude_lines =
@jit
@numba.njit
@njit

[codespell]

skip = *.genx,*.geny,*.png,*egg*,.git,.hypothesis,.nox,.tox,__pycache__,_build

# Occasionally codespell will have false positives. Put words here that
# should be ignored when codespell checks spellings.
ignore-words-list =
circularly

0 comments on commit 8edd466

Please sign in to comment.