Excelsior: High-fidelity clean architecture linter for Python.
Project description
Captain's Log: High-authority Pylint module for enforcing Prime Directives (Clean Architecture) and preventing Hull Integrity Breaches (Technical Debt) in Python projects.
Enforcing architectural boundaries, dependency rules, and design patterns to ensure the fleet remains operational and modular.
Features
- Layer Boundary Enforcement: Ensures Prime Directives are maintained between Domain, UseCase, and Infrastructure.
- The Silent Core Rule (W9013): Guarantees that Domain/UseCase layers remain free of
print,logging, and console I/O, forcing delegation to Interfaces/Adapters. - Dependency Injection Checks: Forbids unauthorized instantiation of infrastructure modules within UseCases.
- Design Pattern Enforcement: Detects "naked returns" and other architectural anomalies.
- Law of Demeter: Prevents tight coupling through deep method chains.
- Contract Integrity: Verifies that Infrastructure implements Domain Protocols correctly.
- Anti-Bypass Guard: Prevents "lazy" disabling of Prime Directives without high-level authorization (Justification).
Docking Procedures
pip install pylint-clean-architecture
Flight Manual
Add the plugin to your pyproject.toml or Pylint configuration:
[tool.pylint.main]
load-plugins = ["clean_architecture_linter"]
Run Pylint as usual:
pylint src/
AI Coding Assistant Support
The clean-arch-init command generates architectural instructions for AI agents (like Cursor or GitHub Copilot) to prevent "Split Brain" issues by teaching the AI your project's rules before it writes code.
Usage:
clean-arch-init
Outcome: This creates a customized .agent/instructions.md file based on the layer names defined in the project's Console Calibration.
Console Calibration
The module is calibrated via [tool.clean-arch] in pyproject.toml.
[tool.clean-arch]
# 1. Project Type Presets (generic, cli_app, fastapi_sqlalchemy)
project_type = "generic"
# 2. Strict Visibility Enforcement
visibility_enforcement = true
# 3. Silent Core Calibration
silent_layers = ["Domain", "UseCase"]
allowed_io_interfaces = ["TelemetryPort", "LoggerPort"]
# 4. Shared Kernel (Allow cross-cutting concerns anywhere)
shared_kernel_modules = ["logging_utils", "clean_architecture_linter.interface.telemetry"]
# 5. Custom Layer Mapping (Map directory regex patterns to layers)
[tool.clean-arch.layer_map]
"services" = "UseCase"
"infrastructure/clients" = "Infrastructure"
"domain/models" = "Domain"
Prime Directives
See RULES.md for a complete catalog of enforced Prime Directives and "Clean Fix" examples.
Mission Log
- CHANGELOG.md - Mission history and architectural updates
Contributing
- Fork the repo.
- Install dependencies:
make install. - Run tests:
make test. - Submit a PR.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylint_clean_architecture-1.5.1.tar.gz.
File metadata
- Download URL: pylint_clean_architecture-1.5.1.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56646763d5d2df6c2f2b681ed5ba6eb26457d490e121a5acefd0580e15462df9
|
|
| MD5 |
5d46b203ebbacaece3a867c68f2778cb
|
|
| BLAKE2b-256 |
744b5ea5fffdd0c249ce9ebd2d3d69fd27cf95e6c81d14300fc5467659a72cd5
|
Provenance
The following attestation bundles were made for pylint_clean_architecture-1.5.1.tar.gz:
Publisher:
publish.yml on noah-goodrich/pylint-clean-architecture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylint_clean_architecture-1.5.1.tar.gz -
Subject digest:
56646763d5d2df6c2f2b681ed5ba6eb26457d490e121a5acefd0580e15462df9 - Sigstore transparency entry: 829568810
- Sigstore integration time:
-
Permalink:
noah-goodrich/pylint-clean-architecture@20c8aeaa1ec2f763ba3cf51a870ea5aa309d63aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/noah-goodrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20c8aeaa1ec2f763ba3cf51a870ea5aa309d63aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylint_clean_architecture-1.5.1-py3-none-any.whl.
File metadata
- Download URL: pylint_clean_architecture-1.5.1-py3-none-any.whl
- Upload date:
- Size: 35.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da87fc9816ebfcff666f20ee8950891a770887bb0898c7ad00d3b4ecbd35d30b
|
|
| MD5 |
ef0d2f38fac7c07ae7f0d050a2c4bb9b
|
|
| BLAKE2b-256 |
91692b7846f913a2f22976b4a26bc46f004a6a6295461a8df3b2b57399bb41f2
|
Provenance
The following attestation bundles were made for pylint_clean_architecture-1.5.1-py3-none-any.whl:
Publisher:
publish.yml on noah-goodrich/pylint-clean-architecture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylint_clean_architecture-1.5.1-py3-none-any.whl -
Subject digest:
da87fc9816ebfcff666f20ee8950891a770887bb0898c7ad00d3b4ecbd35d30b - Sigstore transparency entry: 829568834
- Sigstore integration time:
-
Permalink:
noah-goodrich/pylint-clean-architecture@20c8aeaa1ec2f763ba3cf51a870ea5aa309d63aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/noah-goodrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20c8aeaa1ec2f763ba3cf51a870ea5aa309d63aa -
Trigger Event:
push
-
Statement type: