Skip to content

Commit 830172c

Browse files
committed
fix: markdown linting path and handles no files found
fix: pin markdownlnt version to 0.9.35 fix the issue caused by Markdown linter updates canonical/sphinx-docs-starter-pack#509 fix: do not fail if no markdown files found
1 parent dddc65f commit 830172c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pa11y-install:
7474
}
7575

7676
pymarkdownlnt-install:
77-
@. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/pymarkdown || pip install pymarkdownlnt
77+
@. $(VENV); test -d $(VENVDIR)/lib/python*/site-packages/pymarkdown || pip install pymarkdownlnt==0.9.35
7878

7979
install: $(VENVDIR)
8080

@@ -110,7 +110,16 @@ pa11y: pa11y-install html
110110
find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y)
111111

112112
lint-md: pymarkdownlnt-install
113-
@. $(VENV); pymarkdownlnt --config $(SPHINXDIR)/.pymarkdown.json scan --recurse --exclude=./$(SPHINXDIR)/** $(SOURCEDIR)
113+
@. $(VENV); pymarkdownlnt --config $(SPHINXDIR)/.pymarkdown.json \
114+
--return-code-scheme explicit \
115+
scan --recurse \
116+
--exclude=$(SPHINXDIR)/** $(SOURCEDIR); \
117+
status=$$?; \
118+
if [ $$status -eq 1 ]; then \
119+
echo "pymarkdownlnt: no Markdown files found (NO_FILES_TO_SCAN)."; \
120+
exit 0; \
121+
fi; \
122+
exit $$status
114123

115124
vale-install: install
116125
@. $(VENV); test -f $(VALE_CONFIG) || python3 $(SPHINXDIR)/get_vale_conf.py

0 commit comments

Comments
 (0)