fix: Testisolation - kb_dir repointet config.ROOT, lint loest Kollektionen gegen den uebergebenen Baum auf (4.1.1, #44)
Files changed: - CHANGES.md - VERSION - instructions/dev/testing-conventions.md - tools/chemenu/lint_core.py - tools/chemenu/tests/conftest.py - tools/chemenu/tests/test_hermetic_env.py - tools/chemenu/tests/test_lint.py
This commit is contained in:
@@ -165,9 +165,15 @@ def run_lint(kb_dir: Path) -> dict:
|
||||
# propagated, a deleted page, or a URL pasted where a title belongs - used
|
||||
# to pass every check. Which fields hold page titles is declared by each
|
||||
# type-spec's `page_ref_fields:`, not hardcoded here.
|
||||
# Resolved against the directory `run_lint()` was handed, not against
|
||||
# `config.KB_DIR`. A page under a tree that is not the configured corpus -
|
||||
# every fixture tree, and any `lint <path>` aimed elsewhere - raised
|
||||
# `ValueError` here and read as "no collection", which made the label
|
||||
# authorisation below skip the edge in silence rather than judge it
|
||||
# (Gitea #44).
|
||||
def _collection_of(page):
|
||||
try:
|
||||
return page.path.relative_to(config.KB_DIR).parts[0]
|
||||
return page.path.relative_to(kb_dir).parts[0]
|
||||
except (ValueError, IndexError):
|
||||
return None
|
||||
|
||||
@@ -211,7 +217,9 @@ def run_lint(kb_dir: Path) -> dict:
|
||||
destination = _collection_of(target_page)
|
||||
if destination is None:
|
||||
continue
|
||||
allowed = kb_collections.authorised_labels(source_collection, destination)
|
||||
allowed = kb_collections.authorised_labels(
|
||||
source_collection, destination, kb_dir
|
||||
)
|
||||
if edge.label not in allowed:
|
||||
unauthorised_labels.append(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user