Skip to content

Code quality

ALN** occurrences by order of importance

NOQA Number of occurrences
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 3
ALN002: Checks that we don't import components in shared 3
ALN077: Check for usage of backref in SQLAlchemy relationships and suggest using back_populates instead. 2
ALN083: Flake8 plugin to check ProfileService constructor usage. 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. 1
ALN089: pytest fixtures with autouse=True in conftest.py files can have unwanted side-effects as they will be used in any tests in the subfolders and can inadvertently use other fixtures that add functionality. Instead, mark tests that need the fixture explicitly with @pytest.mark.usefixtures("fixture_name") or use the fixture as a parameter. 1

Listing of files of the most critical ALN**

ALN043 occurs 3 times

File:line Content
components/onboarding/conftest.py:340 ⧉ from components.authentication.bootstrap.load_all_models import ( # noqa: ALN043 # this should be allowed
components/onboarding/conftest.py:343 ⧉ from components.global_profile.bootstrap.load_all_models import ( # noqa: ALN043 # this should be allowed
components/onboarding/conftest.py:397 ⧉ from components.global_profile.internal.infrastructure.unit_of_work import ( # noqa: ALN043