Add IMPORT-001 and IMPORT-002 rules to enforce module separation: - IMPORT-001 (ERROR): Core module imports from optional module - IMPORT-002 (WARNING): Optional module imports without declared dependency The validator now: - Detects imports from optional modules in core modules (contracts, core, tenancy, cms, customers, billing, payments, messaging) - Detects imports between optional modules without dependency declaration - Skips TYPE_CHECKING blocks (valid for type hints) - Skips docstring examples (false positive prevention) - Suggests using provider patterns (MetricsProvider, WidgetProvider) This enforces the architectural rule: "Core modules NEVER import from optional modules" as documented in cross-module-import-rules.md. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
219 KiB
Executable File
219 KiB
Executable File