forked from AFPy/python-docs-fr
Fully working CI (#118)
Ça commence à marcher, par contre on a un souci avec un :rfc: dans pospell : <rst-doc>:1: (ERROR/3) RFC number must be a number greater than or equal to 1; "la spécification correspondante <5424#section-6>" is invalid. while parsing: La :rfc:`5424` requiert qu’un message Unicode soit envoyé à un démon *syslog* sous la forme d’un ensemble d’octets ayant la structure suivante : un composant ASCII pur facultatif, suivi d’une marque d’ordre d’octet (*BOM* pour *Byte Order Mark* en anglais) UTF-8, suivie de contenu Unicode UTF-8 (voir la :rfc:`la spécification correspondante <5424#section-6>`). Reviewed-on: AFPy/python-docs-fr#118
This commit is contained in:
parent
67f8f6cd58
commit
c68566b785
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,3 +7,4 @@ venv/
|
||||||
.potodo/
|
.potodo/
|
||||||
locales/
|
locales/
|
||||||
.venv/
|
.venv/
|
||||||
|
.envrc
|
||||||
|
|
38
.scripts/line-length.py
Normal file
38
.scripts/line-length.py
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
"""Measure line length in given files, run as:
|
||||||
|
|
||||||
|
python line-length.py *.po
|
||||||
|
|
||||||
|
It does not count zero-width caracters from the Mn Unicode category
|
||||||
|
(Nonspacing Mark).
|
||||||
|
|
||||||
|
It returns 0 on success, 1 on failure.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from unicodedata import category
|
||||||
|
import fileinput
|
||||||
|
import sys
|
||||||
|
|
||||||
|
SOFT_LIMIT = 80 # used for splitables lines (with spaces in them)
|
||||||
|
HARD_LIMIT = 88 # used for non-splitables lines (without spaces in them)
|
||||||
|
|
||||||
|
|
||||||
|
def clean(line):
|
||||||
|
return "".join(char for char in line if category(char) != "Mn").rstrip("\n")
|
||||||
|
|
||||||
|
|
||||||
|
return_code = 0
|
||||||
|
|
||||||
|
for line in fileinput.input(encoding="utf-8"):
|
||||||
|
line = clean(line)
|
||||||
|
limit = SOFT_LIMIT if line.count(" ") > 1 else HARD_LIMIT
|
||||||
|
if len(line) > limit:
|
||||||
|
print(
|
||||||
|
f"{fileinput.filename()}:{fileinput.filelineno()} line too long "
|
||||||
|
f"({len(line)} > {limit} characters)",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
return_code = 1
|
||||||
|
|
||||||
|
|
||||||
|
sys.exit(return_code)
|
|
@ -4,7 +4,10 @@ pipeline:
|
||||||
test:
|
test:
|
||||||
image: python
|
image: python
|
||||||
commands:
|
commands:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y hunspell hunspell-fr-comprehensive
|
||||||
- python3 -m pip install -r requirements.txt
|
- python3 -m pip install -r requirements.txt
|
||||||
- sphinx-lint --enable all --disable line-too-long *.po */*.po
|
- BRANCH="$(grep ^BRANCH Makefile | awk '{print $3}')"
|
||||||
- pospell -p dict -l fr_FR *.po */*.po
|
- git fetch origin --no-tags +refs/heads/$BRANCH
|
||||||
- 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
|
- git branch $BRANCH origin/$BRANCH
|
||||||
|
- make verifs
|
||||||
|
|
29
Makefile
29
Makefile
|
@ -85,7 +85,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: ensure_prerequisites
|
all: ensure_build_prerequisites
|
||||||
git -C venv/cpython checkout $(CPYTHON_CURRENT_COMMIT) || (git -C venv/cpython fetch && git -C venv/cpython checkout $(CPYTHON_CURRENT_COMMIT))
|
git -C venv/cpython checkout $(CPYTHON_CURRENT_COMMIT) || (git -C venv/cpython fetch && git -C venv/cpython checkout $(CPYTHON_CURRENT_COMMIT))
|
||||||
mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/
|
mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/
|
||||||
$(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/
|
$(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/
|
||||||
|
@ -108,13 +108,22 @@ venv/cpython/.git/HEAD:
|
||||||
git clone https://github.com/python/cpython venv/cpython
|
git clone https://github.com/python/cpython venv/cpython
|
||||||
|
|
||||||
|
|
||||||
.PHONY: ensure_prerequisites
|
.PHONY: ensure_test_prerequisites
|
||||||
ensure_prerequisites: venv/cpython/.git/HEAD
|
ensure_test_prerequisites:
|
||||||
|
@if ! (pospell --help >/dev/null 2>&1 && potodo --help >/dev/null 2>&1); then \
|
||||||
|
echo "You're missing dependencies please install:"; \
|
||||||
|
echo ""; \
|
||||||
|
echo " python -m pip install -r requirements.txt"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: ensure_build_prerequisites
|
||||||
|
ensure_build_prerequisites: venv/cpython/.git/HEAD
|
||||||
@if ! (blurb help >/dev/null 2>&1 && sphinx-build --version >/dev/null 2>&1); then \
|
@if ! (blurb help >/dev/null 2>&1 && sphinx-build --version >/dev/null 2>&1); then \
|
||||||
git -C venv/cpython/ checkout $(BRANCH); \
|
git -C venv/cpython/ checkout $(BRANCH); \
|
||||||
echo "You're missing dependencies please install:"; \
|
echo "You're missing dependencies please install:"; \
|
||||||
echo ""; \
|
echo ""; \
|
||||||
echo " python -m pip install -r requirements.txt -r venv/cpython/Doc/requirements.txt"; \
|
echo " python -m pip install -r venv/cpython/Doc/requirements.txt"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -123,11 +132,11 @@ htmlview: MODE=htmlview
|
||||||
htmlview: all
|
htmlview: all
|
||||||
|
|
||||||
.PHONY: todo
|
.PHONY: todo
|
||||||
todo: ensure_prerequisites
|
todo: ensure_test_prerequisites
|
||||||
potodo --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open&type=issues' --exclude venv .venv $(EXCLUDED)
|
potodo --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open&type=issues' --exclude venv .venv $(EXCLUDED)
|
||||||
|
|
||||||
.PHONY: wrap
|
.PHONY: wrap
|
||||||
wrap: ensure_prerequisites
|
wrap: ensure_test_prerequisites
|
||||||
@echo "Re wrapping modified files"
|
@echo "Re wrapping modified files"
|
||||||
powrap -m
|
powrap -m
|
||||||
|
|
||||||
|
@ -136,15 +145,15 @@ SRCS = $(shell git diff --name-only $(BRANCH) | grep '.po$$')
|
||||||
DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
|
DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
|
||||||
|
|
||||||
.PHONY: spell
|
.PHONY: spell
|
||||||
spell: ensure_prerequisites $(DESTS)
|
spell: ensure_test_prerequisites $(DESTS)
|
||||||
|
|
||||||
.PHONY: line-length
|
.PHONY: line-length
|
||||||
line-length:
|
line-length:
|
||||||
@echo "Searching for long lines..."
|
@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
|
@python .scripts/line-length.py *.po */*.po
|
||||||
|
|
||||||
.PHONY: sphinx-lint
|
.PHONY: sphinx-lint
|
||||||
sphinx-lint:
|
sphinx-lint: ensure_test_prerequisites
|
||||||
@echo "Checking all files using sphinx-lint..."
|
@echo "Checking all files using sphinx-lint..."
|
||||||
@sphinx-lint --enable all --disable line-too-long *.po */*.po
|
@sphinx-lint --enable all --disable line-too-long *.po */*.po
|
||||||
|
|
||||||
|
@ -154,7 +163,7 @@ $(POSPELL_TMP_DIR)/%.po.out: %.po dict
|
||||||
pospell -p dict -l fr_FR $< && touch $@
|
pospell -p dict -l fr_FR $< && touch $@
|
||||||
|
|
||||||
.PHONY: fuzzy
|
.PHONY: fuzzy
|
||||||
fuzzy: ensure_prerequisites
|
fuzzy: ensure_test_prerequisites
|
||||||
potodo --only-fuzzy --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open&type=issues' --exclude venv .venv $(EXCLUDED)
|
potodo --only-fuzzy --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open&type=issues' --exclude venv .venv $(EXCLUDED)
|
||||||
|
|
||||||
.PHONY: check-headers
|
.PHONY: check-headers
|
||||||
|
|
|
@ -6,7 +6,7 @@ msgstr ""
|
||||||
"Project-Id-Version: Python 3\n"
|
"Project-Id-Version: Python 3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
|
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
|
||||||
"PO-Revision-Date: 2022-12-16 21:12+0100\n"
|
"PO-Revision-Date: 2023-03-28 11:09+0200\n"
|
||||||
"Last-Translator: Nabil Bendafi <nabil@bendafi.fr>\n"
|
"Last-Translator: Nabil Bendafi <nabil@bendafi.fr>\n"
|
||||||
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
|
@ -1762,7 +1762,7 @@ msgid ""
|
||||||
"substitutions."
|
"substitutions."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Les renvois tels que celui-ci ne sont pas très utiles pour effectuer une "
|
"Les renvois tels que celui-ci ne sont pas très utiles pour effectuer une "
|
||||||
"simple recherche dans une chaîne — il n'y a que peu de formats de textes qui "
|
"simple recherche dans une chaîne — il n'y a que peu de formats de textes qui "
|
||||||
"répètent des données ainsi — mais vous verrez bientôt qu'ils sont *très* "
|
"répètent des données ainsi — mais vous verrez bientôt qu'ils sont *très* "
|
||||||
"utiles pour effectuer des substitutions dans les chaînes."
|
"utiles pour effectuer des substitutions dans les chaînes."
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ msgstr ""
|
||||||
"Project-Id-Version: Python 3\n"
|
"Project-Id-Version: Python 3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
|
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
|
||||||
"PO-Revision-Date: 2023-02-09 12:25+0100\n"
|
"PO-Revision-Date: 2023-03-28 11:15+0200\n"
|
||||||
"Last-Translator: Mathieu Dupuy <deronnax@gmail.com>\n"
|
"Last-Translator: Mathieu Dupuy <deronnax@gmail.com>\n"
|
||||||
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
|
@ -2372,7 +2372,7 @@ msgstr ""
|
||||||
"répertoire, et le chemin sur lequel opérer devrait être relatif. Le chemin "
|
"répertoire, et le chemin sur lequel opérer devrait être relatif. Le chemin "
|
||||||
"est donc relatif à ce répertoire. Si le chemin est absolu, *dir_fd* est "
|
"est donc relatif à ce répertoire. Si le chemin est absolu, *dir_fd* est "
|
||||||
"ignoré (pour les systèmes POSIX, Python appelle la version avec un suffixe "
|
"ignoré (pour les systèmes POSIX, Python appelle la version avec un suffixe "
|
||||||
"``at`` et potentiellement préfixée avec ``f`` — par exemple ``faccessat`` au "
|
"``at`` et potentiellement préfixée avec ``f`` — par exemple ``faccessat`` au "
|
||||||
"lieu de ``access``)."
|
"lieu de ``access``)."
|
||||||
|
|
||||||
#: library/os.rst:1733
|
#: library/os.rst:1733
|
||||||
|
|
Loading…
Reference in New Issue
Block a user