Skip to content

Commit

Permalink
build: add check-rst target to lint rst
Browse files Browse the repository at this point in the history
Add a target to lint the rst files that are not part of documentation
under doc/ or tests under test/ to catch errors before pushing.
  • Loading branch information
jnikula committed Oct 4, 2023
1 parent cd9f3af commit 6d9f0a9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

dir := .

RST := $(RST) CHANGELOG.rst CONTRIBUTING.rst README.rst

FLAKE8_IGNORE=\
E302,\
E305,\
Expand All @@ -25,6 +27,10 @@ FLAKE8_IGNORE=\
check:
flake8 --extend-ignore="$(FLAKE8_IGNORE)" --max-line-length=100 src/hawkmoth test

.PHONY: check-rst
check-rst:
rst-lint --level warning $(RST)

# assume virtual environment is used for dist and upload
.PHONY: build-tools
build-tools:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ flake8
pytest
pytest-cov
pytest-xdist
restructuredtext_lint
sphinx
strictyaml
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dev =
pytest
pytest-cov
pytest-xdist
restructuredtext_lint
strictyaml

[options.package_data]
Expand Down
2 changes: 2 additions & 0 deletions test/Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

test_dir := test

RST := $(RST) $(test_dir)/README.rst

.PHONY: test
test:
pytest -n auto $(test_dir)
Expand Down

0 comments on commit 6d9f0a9

Please sign in to comment.