Add sphinx-lint and awk-based line length detector to make verifs. (#6)

Reviewed-on: AFPy/python-docs-fr#6
Co-authored-by: Julien Palard <julien@palard.fr>
Co-committed-by: Julien Palard <julien@palard.fr>
This commit is contained in:
Julien Palard 2022-11-21 21:14:49 +00:00 committed by Christophe Nanteuil
parent 5d3f94ec82
commit 6f8ad70e25
3 changed files with 15 additions and 3 deletions

View File

@ -137,9 +137,19 @@ DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
.PHONY: spell
spell: ensure_prerequisites $(DESTS)
.PHONY: line-length
line-length:
@echo "Searching for long lines..."
@awk '{if (length(gensub(/శ్రీనివాస్/, ".", "g", $$0)) > 80 && length(gensub(/[^ ]/, "", "g")) > 1) {print FILENAME ":" FNR, "line too long:", $$0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}' *.po */*.po
.PHONY: sphinx-lint
sphinx-lint:
@echo "Checking all files using sphinx-lint..."
@sphinx-lint --enable all --disable line-too-long *.po */*.po
$(POSPELL_TMP_DIR)/%.po.out: %.po dict
@echo "Pospell checking $<..."
mkdir -p $(@D)
@mkdir -p $(@D)
pospell -p dict -l fr_FR $< && touch $@
.PHONY: fuzzy
@ -147,7 +157,7 @@ fuzzy: ensure_prerequisites
potodo -f --exclude venv .venv $(EXCLUDED)
.PHONY: verifs
verifs: spell
verifs: spell line-length sphinx-lint
.PHONY: clean
clean:

View File

@ -262,7 +262,8 @@ msgstr "itérateur de générateur asynchrone"
#: glossary.rst:113
msgid "An object created by a :term:`asynchronous generator` function."
msgstr "Objet créé par un :term:`générateur asynchrone <asynchronous generator>`."
msgstr ""
"Objet créé par un :term:`générateur asynchrone <asynchronous generator>`."
#: glossary.rst:115
msgid ""

View File

@ -1 +1,2 @@
poutils==0.13.0
sphinx-lint