Pylint is a Python static-analysis tool that detects coding errors, style problems, and maintainability issues. It can also enforce project-specific architecture before code reaches review. section 7.4.1
A custom Pylint plugin can:
- Inspect imports and report psycopg usage outside designated modules or directories. section 7.4.1
- Provide an automated guardrail that complements code reviews and technical reviews. section 7.4.1
Restricted database imports
A PsycopgImportChecker subclasses BaseChecker, defines a custom error message, and checks import nodes so psycopg is used only in approved modules. section 7.4.1
