Petites corrections

This commit is contained in:
julien
2026-08-07 19:06:45 +02:00
parent 80769f283a
commit 7e09d12345
3 changed files with 2 additions and 15 deletions
-1
View File
@@ -71,7 +71,6 @@ SECTION_FIELDS = {
}
LIST_FIELDS = frozenset({"logograms", "lectures", "themes", "genres"})
URL_TERM_FIELDS = frozenset({"themes", "genres"})
CONTENT_SECTIONS = frozenset(SECTION_FIELDS) | {"vocabulaire"}
UPDATED_LINE_RE = re.compile(r"(?m)^(?:#\s*)?updated\s*=.*?(?=\r?$)")
+1 -13
View File
@@ -12,7 +12,6 @@ from _schema import (
LIST_FIELDS,
SECTION_FIELDS,
UPDATED_LINE_RE,
URL_TERM_FIELDS,
VOCABULARY_FIELDS,
)
@@ -118,18 +117,7 @@ def check_fields(
label = f"{table_name}.{field}"
if field in LIST_FIELDS:
if check_string_list(table[field], label, path, validator) and field in URL_TERM_FIELDS:
spaced_terms = [
term
for term in table[field]
if any(char.isspace() for char in term)
]
if spaced_terms:
validator.error(
path,
f"{label} doit utiliser des tirets à la place des espaces : "
+ ", ".join(repr(term) for term in spaced_terms),
)
check_string_list(table[field], label, path, validator)
else:
check_type(table[field], str, label, path, validator)