Skip to content

Commit 357e5f3

Browse files
committed
feat: Run doc8 via pre-commit
1 parent d349c72 commit 357e5f3

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

.pre-commit-config.yaml

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

14+
- id: doc8
15+
name: doc8
16+
entry: doc8
17+
language: system
18+
files: \.rst$
19+
require_serial: true
20+
1421
- id: flake8
1522
name: flake8
1623
entry: flake8

docs/contributing.rst

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,20 @@ More details on using ``unittest`` are `here
4545
Code quality checks
4646
^^^^^^^^^^^^^^^^^^^
4747

48-
PySTAC uses `flake8 <http://flake8.pycqa.org/en/latest/>`_ and `black
49-
<https://github.com/psf/black>`_ for code formatting and style checks.
48+
PySTAC uses
5049

51-
To run both:
50+
- `black <https://github.com/psf/black>`_ for Python code formatting
51+
- `doc8 <https://github.com/pycqa/doc8>`__ for style checking on RST files in the docs
52+
- `flake8 <http://flake8.pycqa.org/en/latest/>`_ for Python style checks
53+
- `mypy <http://www.mypy-lang.org/>`_ for Python type annotation checks
5254

53-
.. code-block:: bash
54-
55-
> pre-commit run --all-files
56-
57-
We also use `doc8 <https://github.com/pycqa/doc8>`__ for style checking on RST files in
58-
the docs.
59-
60-
To check doc formatting:
55+
To run all of these:
6156

6257
.. code-block:: bash
6358
64-
> doc8 docs
59+
> pre-commit run --all-files
6560
66-
You can also run the ``./scripts/test`` script to run unit tests, check code style with
67-
``flake8`` and ``black``, and check type annotations using ``mypy``.
61+
You can also run the ``./scripts/test`` script to run all of the above and unit tests.
6862

6963
CHANGELOG
7064
^^^^^^^^^

scripts/lint

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

55
echo
6-
echo " -- CHECKING WITH BLACK, FLAKE8 AND MYPY --"
6+
echo " -- CHECKING WITH BLACK, DOC8, FLAKE8 AND MYPY --"
77
echo
88

99
pre-commit run --all-files
@@ -12,13 +12,6 @@ echo
1212
echo " -- CHECKING SPELLING WITH CODESPELL --"
1313
echo
1414

15-
echo
16-
echo " -- LINTING RST FILES WITH DOC8 --"
17-
echo
18-
19-
doc8 docs -q
20-
21-
2215
# Code spelling
2316
codespell -I .codespellignore -f \
2417
pystac/*.py pystac/**/*.py \

0 commit comments

Comments
 (0)