v0.5.3-pre.002
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# file: scripts/audit_rust_general_rules.py
|
||||
# version: 10
|
||||
# version: 11
|
||||
|
||||
"""Audit mechanically verifiable Rust rules shared by all Rust projects."""
|
||||
|
||||
@@ -77,6 +77,15 @@ def audit_file(root: pathlib.Path, path: pathlib.Path) -> list[Violation]:
|
||||
violations.append(Violation("RUST003", relative, max(len(lines), 1), "file must end with exactly one newline"))
|
||||
for index, line in enumerate(lines, 1):
|
||||
stripped = line.strip()
|
||||
if "pub(in " in stripped or "pub(super)" in stripped:
|
||||
violations.append(
|
||||
Violation(
|
||||
"RUST027",
|
||||
relative,
|
||||
index,
|
||||
"restricted public visibility is forbidden; use private or `pub(crate)` with crate-root re-export",
|
||||
)
|
||||
)
|
||||
if stripped.startswith("pub mod "):
|
||||
violations.append(
|
||||
Violation(
|
||||
|
||||
Reference in New Issue
Block a user