Skip to content

Code quality

ALN** occurrences by order of importance

NOQA Number of occurrences
ALN069: You can't import models from other components, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 10
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 7
ALN039: The module public cannot import other components (or from apps/), it's meant to be the public interface of the component #{self.component_name}, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 3
ALN027: This class checks that no protected attribute access is used. 5
ALN037: @property are not serialized by dataclass_json. If not a problem for your use case, please ignore (# noqa: ALN037). "See this Notion page: https://www.notion.so/alaninsurance/Dataclass-the-good-parts-8f387ec2a8e24a55af294237b97dc210#a611a9154af448a38e552c61415169df ⧉ 1
ALN072: Functions decorated with @enqueueable should not use non-primitive type arguments. The function is used by RQ and the arguments must be serializable and robust for code moves/refactors. 3
ALN085: Enforces SQLAlchemy 2.0 query style by detecting deprecated patterns that will be removed in SQLAlchemy 2.0. This linter checks for: 1. Usage of session.query() which is deprecated in favor of session.scalar(), session.scalars(), or session.execute() Note: Other SQLAlchemy 2.0 deprecation warnings are already being turned into errors at runtime by the _turn_sql_alchemy_warning_into_errors function in backend/shared/models/orm/sqlalchemy.py. 17

Listing of files of the most critical ALN**

ALN069 occurs 10 times

File:line Content
components/emailing/external/api/legacy_email_log.py:5 ⧉ from components.be.internal.models.be_email_log import ( # noqa: ALN069
components/emailing/external/api/legacy_email_log.py:17 ⧉ from components.es.internal.models.es_email_log import ( # noqa: ALN069
components/emailing/external/api/legacy_email_log.py:20 ⧉ from components.fr.internal.models.email_log import ( # noqa: ALN069
components/emailing/external/api/legacy_email_log.py:300 ⧉ from components.be.internal.models.be_email_log import ( # noqa: ALN069
components/emailing/external/api/legacy_email_log.py:303 ⧉ from components.es.internal.models.es_email_log import ( # noqa: ALN069
components/emailing/external/api/legacy_email_log.py:306 ⧉ from components.fr.internal.models.email_log import ( # noqa: ALN069
components/emailing/external/tests/test_legacy_email_log.py:10 ⧉ from components.fr.internal.models.email_log import ( # noqa: ALN069
components/emailing/public/entities/email.py:21 ⧉ from components.fr.internal.models.email_log import ( # noqa: ALN039,ALN069
components/emailing/internal/commands/backfill_shoot.py:51 ⧉ from components.fr.internal.models.email_log import ( # noqa: ALN069
components/emailing/internal/events/tests/test_on_customer_io_webhook_called.py:14 ⧉ from components.fr.internal.models.email_log import EmailLog # noqa: ALN069

ALN043 occurs 7 times

File:line Content
components/emailing/conftest.py:164 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043
components/emailing/external/tests/test_legacy_email_log.py:13 ⧉ from components.fr.internal.tests.factories.email_log import ( # noqa: ALN043
components/emailing/public/shoot.py:34 ⧉ from components.fr.internal.queuing.config import ( # noqa: ALN039,ALN043
components/emailing/public/tests/test_webhook.py:10 ⧉ from components.fr.internal.tests.factories.email_log import ( # noqa: ALN039,ALN043
components/emailing/internal/commands/backfill_shoot.py:8 ⧉ from components.fr.internal.queuing.config import ( # noqa: ALN043
components/emailing/internal/events/tests/test_on_customer_io_webhook_called.py:15 ⧉ from components.fr.internal.tests.factories.prospect import ( # noqa: ALN043
components/emailing/internal/events/tests/test_on_customer_io_webhook_called.py:18 ⧉ from components.fr.internal.tests.factories.user import UserFactory # noqa: ALN043

ALN039 occurs 3 times

File:line Content
components/emailing/public/shoot.py:34 ⧉ from components.fr.internal.queuing.config import ( # noqa: ALN039,ALN043
components/emailing/public/entities/email.py:21 ⧉ from components.fr.internal.models.email_log import ( # noqa: ALN039,ALN069
components/emailing/public/tests/test_webhook.py:10 ⧉ from components.fr.internal.tests.factories.email_log import ( # noqa: ALN039,ALN043