From 6d9f0a96c92bfca59843a948a868d8784db8960c Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 13 Aug 2023 11:45:23 +0300 Subject: [PATCH] build: add check-rst target to lint rst 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. --- Makefile.local | 6 ++++++ requirements.txt | 1 + setup.cfg | 1 + test/Makefile.local | 2 ++ 4 files changed, 10 insertions(+) diff --git a/Makefile.local b/Makefile.local index 223ee45b..24acd2fe 100644 --- a/Makefile.local +++ b/Makefile.local @@ -15,6 +15,8 @@ dir := . +RST := $(RST) CHANGELOG.rst CONTRIBUTING.rst README.rst + FLAKE8_IGNORE=\ E302,\ E305,\ @@ -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: diff --git a/requirements.txt b/requirements.txt index e3a68ec7..351edc4e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,6 @@ flake8 pytest pytest-cov pytest-xdist +restructuredtext_lint sphinx strictyaml diff --git a/setup.cfg b/setup.cfg index 6ddc4279..03cd513c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,6 +48,7 @@ dev = pytest pytest-cov pytest-xdist + restructuredtext_lint strictyaml [options.package_data] diff --git a/test/Makefile.local b/test/Makefile.local index c2061a0f..fc63b79f 100644 --- a/test/Makefile.local +++ b/test/Makefile.local @@ -4,6 +4,8 @@ test_dir := test +RST := $(RST) $(test_dir)/README.rst + .PHONY: test test: pytest -n auto $(test_dir)