Add import-linter layer contract with tests
Enforce inward-only imports between domain, ports, application, adapters and evals; unlisted packages fail. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2c55a0b749
commit
81e05acd47
3 files changed
+247
No files matched your search
@@ -28,6 +28,7 @@ dev = [
|
||||
"pre-commit>=4",
|
||||
"pre-commit-hooks>=5",
|
||||
"types-pyyaml>=6.0.12.20261122",
|
||||
"import-linter>=2.17",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
@@ -56,3 +57,18 @@ minversion = "9.0"
|
||||
testpaths = ["tests"]
|
||||
addopts = ["-ra", "--strict-markers", "--strict-config"]
|
||||
xfail_strict = true
|
||||
|
||||
[tool.importlinter]
|
||||
root_package = "chemenu"
|
||||
|
||||
[[tool.importlinter.contracts]]
|
||||
id = "layers"
|
||||
name = "Layers import inwards only"
|
||||
type = "layers"
|
||||
containers = ["chemenu"]
|
||||
layers = [
|
||||
"application | adapters | evals",
|
||||
"ports",
|
||||
"domain",
|
||||
]
|
||||
exhaustive = true
|
||||
Reference in new issue
Block a user