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 ⧉", |
22 |
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 ⧉", |
7 |
| ALN027: This class checks that no protected attribute access is used. | 13 |
| ALN079: Check for direct instantiation of AlanBaseFactory or its derived classes. Always use the .create() class method instead of direct instantiation. | 14 |
| ALN080: The Model.query.get(...) method is considered legacy as of the 1.x series of SQLAlchemy and will be removed. Use " current_session.get(Model, ...) instead. | 2 |
| 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. | 165 |
Listing of files of the most critical ALN**¶
ALN069 occurs 5 times¶
| File:line | Content |
|---|---|
| components/employment/public/tests/test_sources_configuration.py:46 ⧉ | from components.fr.internal.models.enums.employee_termination_type import ( # noqa: ALN039,ALN069 |
| components/employment/public/tests/blocked_movements_utils.py:26 ⧉ | from components.fr.internal.models.company import ( # noqa: ALN039,ALN069 |
| components/employment/internal/commands/stale_invitations.py:21 ⧉ | from components.fr.internal.models.enums.bot_users import ( # noqa: ALN069 |
| components/employment/internal/business_logic/queries/tests/test_blocked_movements.py:3 ⧉ | from components.be.internal.models.tests.factories import ( # noqa: ALN069 |
| components/employment/internal/business_logic/queries/tests/test_blocked_movements.py:10 ⧉ | from components.es.internal.models.tests.factories import ( # noqa: ALN069 |
ALN043 occurs 22 times¶
| File:line | Content |
|---|---|
| components/employment/public/business_logic/actions/delete_user.py:28 ⧉ | from components.fr.internal.business_logic.helpers.delete import ( # noqa: ALN039,ALN043 # typing |
| components/employment/public/business_logic/actions/tests/test_delete_user.py:15 ⧉ | from components.fr.internal.business_logic.helpers.delete import ( # noqa: ALN039,ALN043 # test setup |
| components/employment/public/business_logic/actions/tests/test_delete_user.py:18 ⧉ | from components.fr.internal.tests.factories.user import ( # noqa: ALN039,ALN043 # test setup |
| components/employment/public/tests/test_sources_configuration.py:49 ⧉ | from components.fr.internal.tests.factories.policy import ( # noqa: ALN039,ALN043 |
| components/employment/public/tests/blocked_movements_utils.py:29 ⧉ | from components.fr.internal.tests.factories.user import ( # noqa: ALN039,ALN043 |
| components/employment/internal/commands/stale_invitations.py:18 ⧉ | from components.fr.internal.commands.helpers.authenticate_bot import ( # noqa: ALN043 # this is shared tooling |
| components/employment/internal/commands/stale_invitations.py:105 ⧉ | from components.fr.internal.services.customerio import ( # noqa: ALN043 |
| components/employment/internal/commands/tests/test_stale_invitations.py:3 ⧉ | from components.contracting.external.tests_imports import ( # noqa: ALN043 |
| components/employment/internal/commands/tests/test_stale_invitations.py:28 ⧉ | from components.fr.internal.tests.factories.company import ( # noqa: ALN043 |
| components/employment/internal/commands/tests/test_stale_invitations.py:31 ⧉ | from components.fr.internal.tests.factories.email_log import ( # noqa: ALN043 |
| components/employment/internal/commands/tests/test_stale_invitations.py:34 ⧉ | from components.fr.internal.tests.factories.user import UserFactory # noqa: ALN043 |
| components/employment/internal/controllers/tests/test_blocked_movement_controller.py:23 ⧉ | from components.fr.internal.tests.factories.account import ( # noqa: ALN043 |
| components/employment/internal/controllers/tests/test_blocked_movement_controller.py:26 ⧉ | from components.fr.internal.tests.factories.company import ( # noqa: ALN043 |
| components/employment/internal/controllers/tests/test_stale_invitation_controller.py:19 ⧉ | from components.fr.internal.business_logic.company.actions.admin import ( # noqa: ALN043 |
| components/employment/internal/controllers/tests/test_stale_invitation_controller.py:22 ⧉ | from components.fr.internal.tests.factories.company import ( # noqa: ALN043 |
| components/employment/internal/business_logic/actions/blocked_movement.py:193 ⧉ | from components.fr.internal.fr_employment_data_sources.business_logic.global_affiliation_transition.ingest_employment_declaration import ( # noqa: ALN043 |
| components/employment/internal/business_logic/actions/stale_invitations.py:38 ⧉ | from components.fr.internal.queuing.config import ( # noqa: ALN043 |
| components/employment/internal/business_logic/actions/tests/test_blocked_movement.py:67 ⧉ | from components.fr.internal.tests.factories.employment import ( # noqa: ALN043 |
| components/employment/internal/business_logic/queries/blocked_movements.py:239 ⧉ | from components.fr.internal.business_logic.company.queries.company import ( # noqa: ALN043 |
| components/employment/internal/business_logic/queries/tests/test_blocked_movements.py:14 ⧉ | from components.fr.internal.tests.factories.account import ( # noqa: ALN043 |
| components/employment/internal/business_logic/queries/tests/test_blocked_movements.py:17 ⧉ | from components.fr.internal.tests.factories.company import ( # noqa: ALN043 |
| components/employment/internal/tests/test_blocked_movement_creator.py:31 ⧉ | from components.fr.internal.tests.factories.employment import ( # noqa: ALN043 |
ALN039 occurs 7 times¶
| File:line | Content |
|---|---|
| components/employment/public/business_logic/actions/delete_user.py:28 ⧉ | from components.fr.internal.business_logic.helpers.delete import ( # noqa: ALN039,ALN043 # typing |
| components/employment/public/business_logic/actions/tests/test_delete_user.py:15 ⧉ | from components.fr.internal.business_logic.helpers.delete import ( # noqa: ALN039,ALN043 # test setup |
| components/employment/public/business_logic/actions/tests/test_delete_user.py:18 ⧉ | from components.fr.internal.tests.factories.user import ( # noqa: ALN039,ALN043 # test setup |
| components/employment/public/tests/test_sources_configuration.py:46 ⧉ | from components.fr.internal.models.enums.employee_termination_type import ( # noqa: ALN039,ALN069 |
| components/employment/public/tests/test_sources_configuration.py:49 ⧉ | from components.fr.internal.tests.factories.policy import ( # noqa: ALN039,ALN043 |
| components/employment/public/tests/blocked_movements_utils.py:26 ⧉ | from components.fr.internal.models.company import ( # noqa: ALN039,ALN069 |
| components/employment/public/tests/blocked_movements_utils.py:29 ⧉ | from components.fr.internal.tests.factories.user import ( # noqa: ALN039,ALN043 |