Use Python instead of awk for better unicode handling.
This commit is contained in:
parent
7c8e9e4d81
commit
52fcc27bd4
13
Makefile
13
Makefile
|
@ -150,7 +150,18 @@ spell: ensure_test_prerequisites $(DESTS)
|
|||
.PHONY: line-length
|
||||
line-length:
|
||||
@echo "Searching for long lines..."
|
||||
@awk '{line=$$0; gsub(/శ్రీనివాస్/, ".", line); if (length(line) > 80) {print FILENAME ":" FNR, "line too long:", $$0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}' *.po */*.po
|
||||
# soft limit is used for splitables lines (with spaces in them)
|
||||
# hard limit is used for non-splitables lines (without spaces in them)
|
||||
@python -c 'soft_limit=80; \
|
||||
hard_limit=88; \
|
||||
from unicodedata import category; \
|
||||
import fileinput as fi; \
|
||||
clean = lambda line: "".join(char for char in line if category(char) != "Mn").strip(); \
|
||||
[print(f"""{fi.filename()}:{fi.filelineno()} line too long ({len(line)} > {soft_limit if line.count(" ") > 1 else hard_limit} characters)""") \
|
||||
for _line in fi.input(encoding="utf-8") \
|
||||
for line in [clean(_line)] \
|
||||
if line.count(" ") > 1 and len(line) > soft_limit or line.count(" ") <= 1 and len(line) > hard_limit]' \
|
||||
*.po */*.po
|
||||
|
||||
.PHONY: sphinx-lint
|
||||
sphinx-lint: ensure_test_prerequisites
|
||||
|
|
|
@ -6,7 +6,7 @@ msgstr ""
|
|||
"Project-Id-Version: Python 3\n"
|
||||
"Report-Msgid-Bugs-To: \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"
|
||||
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
||||
"Language: fr\n"
|
||||
|
@ -1762,7 +1762,7 @@ msgid ""
|
|||
"substitutions."
|
||||
msgstr ""
|
||||
"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* "
|
||||
"utiles pour effectuer des substitutions dans les chaînes."
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ msgstr ""
|
|||
"Project-Id-Version: Python 3\n"
|
||||
"Report-Msgid-Bugs-To: \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"
|
||||
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
||||
"Language: fr\n"
|
||||
|
@ -2372,7 +2372,7 @@ msgstr ""
|
|||
"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 "
|
||||
"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``)."
|
||||
|
||||
#: library/os.rst:1733
|
||||
|
|
Loading…
Reference in New Issue