Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ testpaths = [
[tool.ruff]
target-version = "py39"
line-length = 120
# The `src` settings makes sure that imports are correctly
# evaluated during formatting when using nested `pyproject.toml`
src = [
"src",
]
extend-exclude = [
"docs",
]
Expand All @@ -146,6 +151,7 @@ select = [
"I", # isort
"N", # pep8-naming
"S", # flake8-bandit
"TID", # flake8-tidy-imports
"RUF", # ruff-specific-rules
]
# Ignoring rules problematic with formatter
Expand Down
2 changes: 2 additions & 0 deletions src/common/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .bootstrap import application_init
from .config import AppConfig

__all__ = ["AppConfig", "application_init"]
3 changes: 2 additions & 1 deletion src/common/logs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from opentelemetry.sdk._logs import LoggingHandler
from structlog.typing import Processor

from ..config import AppConfig
from common.config import AppConfig

from .processors import (
add_logging_open_telemetry_spans,
drop_color_message_key,
Expand Down
16 changes: 16 additions & 0 deletions src/common/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"domains".msg = "Clean Architecture dependency rule break: import of `domains` is not allowed"
"dramatiq_worker".msg = "Clean Architecture dependency rule break: import of `dramatiq_worker` is not allowed"
"http_app".msg = "Clean Architecture dependency rule break: import of `http_app` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"migrations".msg = "Clean Architecture dependency rule break: import of `migrations` is not allowed"
"socketio_app".msg = "Clean Architecture dependency rule break: import of `socketio_app` is not allowed"

# These ignore rules suggest these modules should not be inside `common`.
[tool.ruff.lint.per-file-ignores]
"storage/**/*.py" = ["TID251"] # Storage is allowed to import domains module as it needs the models
"di_container.py" = ["TID251"] # DI Container is allowed to import domains module
10 changes: 10 additions & 0 deletions src/domains/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"dramatiq_worker".msg = "Clean Architecture dependency rule break: import of `dramatiq_worker` is not allowed"
"http_app".msg = "Clean Architecture dependency rule break: import of `http_app` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"migrations".msg = "Clean Architecture dependency rule break: import of `migrations` is not allowed"
"socketio_app".msg = "Clean Architecture dependency rule break: import of `socketio_app` is not allowed"
9 changes: 9 additions & 0 deletions src/dramatiq_worker/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"http_app".msg = "Clean Architecture dependency rule break: import of `http_app` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"migrations".msg = "Clean Architecture dependency rule break: import of `migrations` is not allowed"
"socketio_app".msg = "Clean Architecture dependency rule break: import of `socketio_app` is not allowed"
11 changes: 11 additions & 0 deletions src/gateways/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"domains".msg = "Clean Architecture dependency rule break: import of `domains` is not allowed"
"dramatiq_worker".msg = "Clean Architecture dependency rule break: import of `dramatiq_worker` is not allowed"
"http_app".msg = "Clean Architecture dependency rule break: import of `http_app` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"migrations".msg = "Clean Architecture dependency rule break: import of `migrations` is not allowed"
"socketio_app".msg = "Clean Architecture dependency rule break: import of `socketio_app` is not allowed"
9 changes: 9 additions & 0 deletions src/http_app/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"dramatiq_worker".msg = "Clean Architecture dependency rule break: import of `dramatiq_worker` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"migrations".msg = "Clean Architecture dependency rule break: import of `migrations` is not allowed"
"socketio_app".msg = "Clean Architecture dependency rule break: import of `socketio_app` is not allowed"
9 changes: 9 additions & 0 deletions src/migrations/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"dramatiq_worker".msg = "Clean Architecture dependency rule break: import of `dramatiq_worker` is not allowed"
"http_app".msg = "Clean Architecture dependency rule break: import of `http_app` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"socketio_app".msg = "Clean Architecture dependency rule break: import of `socketio_app` is not allowed"
9 changes: 9 additions & 0 deletions src/socketio_app/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.ruff]
# Extend the `pyproject.toml` file in the parent directory...
extend = "../../pyproject.toml"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"dramatiq_worker".msg = "Clean Architecture dependency rule break: import of `dramatiq_worker` is not allowed"
"http_app".msg = "Clean Architecture dependency rule break: import of `http_app` is not allowed"
"gateways".msg = "Clean Architecture dependency rule break: import of `gateways` is not allowed"
"migrations".msg = "Clean Architecture dependency rule break: import of `migrations` is not allowed"
30 changes: 0 additions & 30 deletions test-cross-domain-imports.sh

This file was deleted.

Loading