list[Finding]: ARCH01 errors for forbidden imports, ARCH02 errors for subpackages the architecture does not list, ARCH04 errors for import cycles not in known_cycles, ARCH03 warnings for listed subpackages that no longer exist or allowed edges nobody uses, ARCH05 warnings for known cycles that have disappeared.
Examples
from pathlib import Pathfrom tempfile import TemporaryDirectoryfrom spotregen import check_architecture, load_spec, make_sample_repowith TemporaryDirectory() as tmp: root = make_sample_repo(Path(tmp) /"demo") spec = load_spec(root)print(check_architecture(spec)) (root /"src/samplepkg/core/bad.py").write_text("from samplepkg.app import main\n")for finding in check_architecture(spec):print(finding.format())
[]
ERROR ARCH01 src/samplepkg/core/bad.py: 'core' imports 'samplepkg.app', but architecture.toml allows only []
ERROR ARCH04 architecture.toml: new import cycle between 'app' and 'core' (not in known_cycles)