Commit 718526de authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

feat: enforce hexagonal layer rules with import-linter

parent fa41ccb0
Loading
Loading
Loading
Loading
+5 −1
Changes for Makefile: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
.PHONY: install clean lint format type precommit test run
.PHONY: install clean lint format type precommit architecture test run

PIP := .venv/bin/pip
DEV ?= false
@@ -41,6 +41,10 @@ precommit:
	make install DEV=true
	.venv/bin/pre-commit run --all-files

architecture:
	make install DEV=true
	.venv/bin/lint-imports --cache-dir .cache/import-linter

test:
	make install DEV=true
	.venv/bin/pytest
+13 −1
Changes for pyproject.toml: 13 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -47,7 +47,19 @@ strict = true
ignore_missing_imports = true

[tool.importlinter]
root_package = "src"
root_package = "portal_service"

[[tool.importlinter.contracts]]
name = "Domain independence"
type = "forbidden"
source_modules = ["portal_service.domain"]
forbidden_modules = ["portal_service.application", "portal_service.api", "portal_service.adapters"]

[[tool.importlinter.contracts]]
name = "Application cannot import infrastructure"
type = "forbidden"
source_modules = ["portal_service.application"]
forbidden_modules = ["portal_service.api", "portal_service.adapters"]

[tool.pytest.ini_options]
asyncio_mode = "auto"