Skip to content

Commit c56e3ae

Browse files
committed
feat: Run codespell via pre-commit
1 parent 357e5f3 commit c56e3ae

File tree

6 files changed

+11
-31
lines changed

6 files changed

+11
-31
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
pip install -r requirements-test.txt
104104
105105
- name: Execute linters & type checkers
106-
run: ./scripts/lint
106+
run: pre-commit run --all-files
107107

108108
vanilla:
109109
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ repos:
1111
stages: [commit]
1212
types: [python]
1313

14+
- id: codespell
15+
name: codespell
16+
entry: codespell
17+
args: [--ignore-words=.codespellignore]
18+
language: system
19+
stages: [commit]
20+
types_or: [jupyter, markdown, python, shell]
21+
1422
- id: doc8
1523
name: doc8
1624
entry: doc8

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ To run these automatically when committing files (runs only on the staged files)
9191

9292
To avoid running these checks when committing, use `git commit --no-verify`.
9393

94-
To check for spelling mistakes in modified files:
95-
96-
```
97-
> git diff --name-only | xargs codespell -I .codespellignore -f
98-
```
99-
10094
You can also run the `./scripts/test` script to check for linting, spelling, and run unit tests.
10195

10296
### Continuous Integration

docs/contributing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Code quality checks
4848
PySTAC uses
4949

5050
- `black <https://github.com/psf/black>`_ for Python code formatting
51+
- `codespell <https://github.com/codespell-project/codespell/>`_ to check code for common misspellings
5152
- `doc8 <https://github.com/pycqa/doc8>`__ for style checking on RST files in the docs
5253
- `flake8 <http://flake8.pycqa.org/en/latest/>`_ for Python style checks
5354
- `mypy <http://www.mypy-lang.org/>`_ for Python type annotation checks

scripts/lint

Lines changed: 0 additions & 23 deletions
This file was deleted.

scripts/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
if [[ -z ${CI} ]]; then
6-
source ./scripts/lint
6+
pre-commit run --all-files
77
fi
88

99
echo

0 commit comments

Comments
 (0)