Petites corrections
This commit is contained in:
@@ -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?$)")
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user