v0.1.0-pre.021
This commit is contained in:
@@ -97,10 +97,10 @@ def audit_kb_lib_tracing(root: pathlib.Path) -> list[Violation]:
|
||||
re.MULTILINE,
|
||||
)
|
||||
for match in re_export_pattern.finditer(root_text):
|
||||
if match.group(1).endswith("_TRACING_TARGET"):
|
||||
if match.group(1).startswith("TRACING_TARGET_"):
|
||||
re_exports.add(match.group(1))
|
||||
target_pattern = re.compile(
|
||||
r'^pub\(crate\) const ([A-Z][A-Z0-9_]+_TRACING_TARGET): &str = "([^"]+)";$',
|
||||
r'^pub\(crate\) const (TRACING_TARGET_[A-Z0-9_]+): &str = "([^"]+)";$',
|
||||
re.MULTILINE,
|
||||
)
|
||||
for constants in sorted((crate / "src").rglob("constants.rs")):
|
||||
@@ -121,7 +121,7 @@ def audit_kb_lib_tracing(root: pathlib.Path) -> list[Violation]:
|
||||
)
|
||||
)
|
||||
macro_pattern = re.compile(
|
||||
r"tracing::(?:debug|error|info|trace|warn)!\(\s*target:\s*crate::([A-Z][A-Z0-9_]+_TRACING_TARGET)"
|
||||
r"tracing::(?:debug|error|info|trace|warn)!\(\s*target:\s*crate::(TRACING_TARGET_[A-Z0-9_]+)"
|
||||
)
|
||||
for path in sorted((crate / "src").rglob("*.rs")):
|
||||
relative = path.relative_to(root).as_posix()
|
||||
@@ -195,6 +195,8 @@ def audit_kb_lib_symbol_prefixes(root: pathlib.Path) -> list[Violation]:
|
||||
kind = match.group(1)
|
||||
name = match.group(2)
|
||||
expected = prefixes[0] if kind in {"const", "static"} else prefixes[2] if kind == "fn" else prefixes[1]
|
||||
if kind in {"const", "static"} and name.startswith("TRACING_TARGET_"):
|
||||
continue
|
||||
if not name.startswith(expected):
|
||||
violations.append(
|
||||
Violation(
|
||||
@@ -438,13 +440,13 @@ def audit_reserved_executor_scaffolds(root: pathlib.Path) -> list[Violation]:
|
||||
"reserved executor must build only an explicit zero-instruction plan",
|
||||
)
|
||||
)
|
||||
if reserved_count != 99:
|
||||
if reserved_count != 98:
|
||||
violations.append(
|
||||
Violation(
|
||||
"KH_EX007",
|
||||
"kb-lib/src/executor",
|
||||
1,
|
||||
f"expected 99 reserved executor boundaries, found {reserved_count}",
|
||||
f"expected 98 reserved executor boundaries, found {reserved_count}",
|
||||
)
|
||||
)
|
||||
return violations
|
||||
|
||||
Reference in New Issue
Block a user