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 ⧉", 5
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 4
ALN059: Checks that all component dependencies are declared in the root of a component 1
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. 9

Listing of files of the most critical ALN**

ALN069 occurs 5 times

File:line Content
components/global_services/internal/queries/feature_flag.py:213 ⧉ from components.fr.internal.models.user import ( # noqa: ALN069
components/global_services/internal/queries/feature_flag.py:224 ⧉ from components.be.internal.models.be_user import ( # noqa: ALN069
components/global_services/internal/queries/feature_flag.py:252 ⧉ from components.fr.internal.models.user import ( # noqa: ALN069
components/global_services/internal/queries/feature_flag.py:272 ⧉ from components.be.internal.models.be_user import ( # noqa: ALN069
components/global_services/internal/queries/feature_flag.py:286 ⧉ from components.es.internal.models.es_user import ( # noqa: ALN069

ALN043 occurs 4 times

File:line Content
components/global_services/internal/queries/tests/test_global_feature_flag.py:4 ⧉ from components.fr.internal.tests.factories.fr_alan_employee_factory import ( # noqa: ALN043
components/global_services/internal/queries/tests/test_global_feature_flag.py:7 ⧉ from components.fr.internal.tests.factories.user import UserFactory # noqa: ALN043
components/global_services/internal/services/push_notifications/push_notifications_local.py:108 ⧉ from components.fr.internal.business_logic.push_notification_token import ( # noqa: ALN043
components/global_services/internal/services/push_notifications/push_notifications_local.py:140 ⧉ from components.fr.internal.business_logic.push_notification_token import ( # noqa: ALN043