8000 Add sphinx-lint and awk-based line length detector to make verifs. (#6) · python/python-docs-fr@6f8ad70 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f8ad70

Browse files
JulienPalardChristophe Nanteuil
authored andcommitted
Add sphinx-lint and awk-based line length detector to make verifs. (#6)
Reviewed-on: https://git.afpy.org/AFPy/python-docs-fr/pulls/6 Co-authored-by: Julien Palard <julien@palard.fr> Co-committed-by: Julien Palard <julien@palard.fr>
1 parent 5d3f94e commit 6f8ad70

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,27 @@ DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
137137
.PHONY: spell
138138
spell: ensure_prerequisites $(DESTS)
139139

140+
.PHONY: line-length
141+
line-length:
142+
@echo "Searching for long lines..."
143+
@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
144+
145+
.PHONY: sphinx-lint
146+
sphinx-lint:
147+
@echo "Checking all files using sphinx-lint..."
148+
@sphinx-lint --enable all --disable line-too-long *.po */*.po
149+
140150
$(POSPELL_TMP_DIR)/%.po.out: %.po dict
141151
@echo "Pospell checking $<..."
142-
mkdir -p $(@D)
152+
@mkdir -p $(@D)
143153
pospell -p dict -l fr_FR $< && touch $@
144154

145155
.PHONY: fuzzy
146156
fuzzy: ensure_prerequisites
147157
potodo -f --exclude venv .venv $(EXCLUDED)
148158

149159
.PHONY: verifs
150-
verifs: spell
160+
verifs: spell line-length sphinx-lint
151161

152162
.PHONY: clean
153163
clean:

glossary.po

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ msgstr "itérateur de générateur asynchrone"
262262

263263
#: glossary.rst:113
264264
msgid "An object created by a :term:`asynchronous generator` function."
265-
msgstr "Objet créé par un :term:`générateur asynchrone <asynchronous generator>`."
265+
msgstr ""
266+
"Objet créé par un :term:`générateur asynchrone <asynchronous generator>`."
266267

267268
#: glossary.rst:115
268269
msgid ""

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
poutils==0.13.0
2+
sphinx-lint

0 commit comments

Comments
 (0)
0