11SHELL := /bin/bash -euxo pipefail
22
3+ # Treat Sphinx warnings as errors
4+ SPHINXOPTS := -W
5+
36.PHONY : lint
47lint :
58 check-manifest .
9+ doc8 .
610 dodgy
711 flake8 .
812 isort --recursive --check-only
@@ -13,14 +17,42 @@ lint:
1317 pylint * .py src tests
1418 pyroma --min 10 .
1519 vulture . --min-confidence 100
16- yapf --diff --recursive src/ tests/
20+ $(MAKE ) -C docs spelling SPHINXOPTS=$(SPHINXOPTS )
21+ $(MAKE ) -C docs linkcheck SPHINXOPTS=$(SPHINXOPTS )
22+ yapf \
23+ --diff \
24+ --recursive \
25+ --exclude versioneer.py \
26+ --exclude src/vws/_version.py \
27+ .
1728
1829.PHONY : fix-lint
1930fix-lint :
2031 # Move imports to a single line so that autoflake can handle them.
2132 # See https://github.com/myint/autoflake/issues/8.
2233 # Then later we put them back.
2334 isort --force-single-line --recursive --apply
24- autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables .
25- yapf --in-place --recursive .
35+ autoflake \
36+ --in-place \
37+ --recursive \
38+ --remove-all-unused-imports \
39+ --remove-unused-variables \
40+ --exclude src/vws/_version.py,versioneer.py \
41+ .
42+ yapf \
43+ --in-place \
44+ --recursive \
45+ --exclude versioneer.py \
46+ --exclude src/vws/_version.py \
47+ .
2648 isort --recursive --apply
49+
50+ .PHONY : docs
51+ docs :
52+ make -C docs clean html SPHINXOPTS=$(SPHINXOPTS )
53+
54+ .PHONY : open-docs
55+ open-docs :
56+ xdg-open docs/build/html/index.html > /dev/null 2>&1 || \
57+ open docs/build/html/index.html > /dev/null 2>&1 || \
58+ echo " Requires 'xdg-open' or 'open' but neither is available."
0 commit comments