From f692b202471701612705f2e4eb56516706f0bf49 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Tue, 8 Apr 2025 09:45:33 +0200 Subject: [PATCH] Remove rule S311 from linting --- gso/utils/helpers.py | 4 ++-- gso/workflows/edge_port/migrate_edge_port.py | 4 ++-- pyproject.toml | 1 + test/fixtures/l3_core_service_fixtures.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gso/utils/helpers.py b/gso/utils/helpers.py index a5c1bc9dc..c20e8a4e7 100644 --- a/gso/utils/helpers.py +++ b/gso/utils/helpers.py @@ -325,8 +325,8 @@ def generate_unique_vc_id(l2c_type: str, max_attempts: int = 100) -> VC_ID | Non def create_vc_id() -> str: """Generate an 8-digit VC_ID starting with '11'.""" if l2c_type == Layer2CircuitType.ETHERNET: - return str(random.randint(30001, 39999)) # noqa: S311 - return str(random.randint(6000, 6999)) # noqa: S311 + return str(random.randint(30001, 39999)) + return str(random.randint(6000, 6999)) for _ in range(max_attempts): vc_id = create_vc_id() diff --git a/gso/workflows/edge_port/migrate_edge_port.py b/gso/workflows/edge_port/migrate_edge_port.py index afd2d6d0f..ecdabd6f3 100644 --- a/gso/workflows/edge_port/migrate_edge_port.py +++ b/gso/workflows/edge_port/migrate_edge_port.py @@ -292,7 +292,7 @@ def migrate_l3_core_services_to_new_node(subscription_id: UUIDstr, tt_number: TT }, ], ], - countdown=random.choice([2, 3, 4, 5]), # noqa: S311 + countdown=random.choice([2, 3, 4, 5]), ) return {"l3_core_services": l3_core_services} @@ -319,7 +319,7 @@ def migrate_l2_circuits_to_new_node(subscription_id: UUIDstr, tt_number: TTNumbe }, ], ], - countdown=random.choice([2, 3, 4, 5]), # noqa: S311 + countdown=random.choice([2, 3, 4, 5]), ) return {"layer2_circuits": layer2_circuits} diff --git a/pyproject.toml b/pyproject.toml index 6fb91172e..34e477ffd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,7 @@ ignore = [ "PLR0913", "PLR0904", "PLW1514", + "S311", ] select = [ "A", diff --git a/test/fixtures/l3_core_service_fixtures.py b/test/fixtures/l3_core_service_fixtures.py index bffe03dae..fc72ca399 100644 --- a/test/fixtures/l3_core_service_fixtures.py +++ b/test/fixtures/l3_core_service_fixtures.py @@ -133,7 +133,7 @@ def access_port_factory(faker, service_binding_port_factory): ): return AccessPort.new( subscription_id=uuid4(), - ap_type=ap_type or random.choice(list(APType)), # noqa: S311 + ap_type=ap_type or random.choice(list(APType)), sbp=service_binding_port or service_binding_port_factory(edge_port=edge_port, partner=partner), ) -- GitLab