Skip to content

Commit 8f5db71

Browse files
committed
Lint doc files with doc8, update Contributing docs
1 parent 9e9b4b1 commit 8f5db71

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

doc8.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[doc8]
2+
3+
ignore-path=docs/_build,docs/tutorials
4+
max-line-length=88

docs/contributing.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,32 @@ More details on using ``unittest`` are `here
4545
Code quality checks
4646
^^^^^^^^^^^^^^^^^^^
4747

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

5151
To run the flake8 style checks:
5252

5353
.. code-block:: bash
5454
55-
> flake8 pystac
56-
> flake8 tests
55+
> flake8 pystac tests
5756
5857
To format code:
5958

6059
.. code-block:: bash
6160
62-
> yapf -ipr pystac
63-
> yapf -ipr tests
61+
> ./scripts/format
6462
65-
You can also run the ``./scripts/test`` script to check flake8 and yapf.
63+
We also use `doc8 <https://github.com/pycqa/doc8>`__ for style checking on RST files in
64+
the docs.
65+
66+
To check doc formatting:
67+
68+
.. code-block:: bash
69+
70+
> doc8 docs
71+
72+
You can also run the ``./scripts/test`` script to run unit tests, check code style with
73+
``flake8`` and ``black``, and check type annotations using ``mypy`` and ``pyright``.
6674

6775
CHANGELOG
6876
^^^^^^^^^

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sphinx-autobuild==0.7.1
1111
sphinxcontrib-fulltoc==1.2.0
1212
nbsphinx==0.7.1
1313
coverage==5.2.*
14+
doc8==0.8.1
1415

1516
# https://github.com/pydata/xarray/issues/5299#issuecomment-840730954
1617
jinja2<3.0

scripts/test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
3535

3636
flake8 pystac tests
3737

38+
echo
39+
echo " -- LINTING RST FILES WITH DOC8 --"
40+
echo
41+
42+
doc8 docs -q
43+
3844
echo
3945
echo " -- CHECKING FORMAT WITH BLACK --"
4046
echo

0 commit comments

Comments
 (0)