Skip to content

Commit 3765e40

Browse files
ahouseholderCopilot
andcommitted
fix: resolve all flake8 lint errors across vultron/ and test/
P1 (runtime crash) fixes: - extractor.py: move VultronEvent/EVENT_CLASS_MAP/VultronTypes imports to module level; remove forward-reference string annotation - helpers.py: remove spurious f-prefix from non-interpolating f-string - robot.py: add missing _parse_args() function - mcp_server.py: fix 9 use-case call signatures (SvcXxx(dl, req).execute()) P3/P4 (unused imports) fixes: - Remove unused imports across 14 test files, 12 demo scripts, 5 vocab example files, and various adapter/use-case modules - Restore BASE_URL in demo modules with # noqa: F401 (needed for test monkeypatching via mp.setattr) - Fix F811 (logging redefinition) in test_embargo_use_cases.py - Fix F841 (assigned-but-unused vars) in test_cli.py, test_create_tree.py, test_create_activity.py, and triggers/embargo.py E402 (imports not at top) fixes: - test_trigger_services.py: move FUTURE_DATETIME constant after all imports - test_performance.py: move logger = ... after all imports; remove unused DataLayer import E203 (.flake8): - Add E203 to extend-ignore (Black-style slice whitespace) All # noqa placement fixed to appear on the opening 'from X import (' line, not on the closing ')' line (where flake8 ignores them). Result: flake8 clean, 985 tests pass, Black unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8f00b01 commit 3765e40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+70
-111
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
extend-ignore = E501
2+
extend-ignore = E203,E501
33
exclude =
44
.git,
55
__pycache__,

test/api/v2/backend/test_outbox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from types import SimpleNamespace
3838
from unittest.mock import MagicMock
3939

40-
import pytest
4140

4241
from vultron.adapters.driving.fastapi import outbox_handler as oh
4342

test/api/v2/backend/test_trigger_services.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
import pytest
2828
from fastapi import HTTPException
29-
30-
FUTURE_DATETIME = datetime(2099, 12, 1, tzinfo=timezone.utc)
31-
3229
from vultron.adapters.driven.db_record import object_to_record
3330
from vultron.adapters.driving.fastapi._trigger_adapter import (
3431
close_report_trigger,
@@ -56,6 +53,8 @@
5653
VulnerabilityReport,
5754
)
5855

56+
FUTURE_DATETIME = datetime(2099, 12, 1, tzinfo=timezone.utc)
57+
5958
# ---------------------------------------------------------------------------
6059
# Fixtures
6160
# ---------------------------------------------------------------------------

test/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
This file provides test session hooks for cleanup of test artifacts.
1818
"""
1919

20-
import os
2120
from pathlib import Path
2221

2322
import pytest

test/core/behaviors/case/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"""
1010

1111
# noqa: F401 — imported for vocabulary registration side-effect
12-
from vultron.wire.as2.vocab.objects.vulnerability_case import (
12+
from vultron.wire.as2.vocab.objects.vulnerability_case import ( # noqa: F401
1313
VulnerabilityCase,
14-
) # noqa: F401
14+
)

test/core/behaviors/case/test_create_tree.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,6 @@ def test_create_case_tree_creates_case_actor(
131131
):
132132
tree = create_create_case_tree(case_obj=case_obj, actor_id=actor.as_id)
133133
bridge.execute_with_setup(tree=tree, actor_id=actor.as_id, activity=None)
134-
all_objects = datalayer.get_all("Service")
135-
case_actors = [
136-
r
137-
for r in all_objects
138-
if isinstance(r, dict)
139-
and r.get("data_", {}).get("context") == case_obj.as_id
140-
]
141134
# Verify at least one CaseActor exists for this case
142135
# (also checking via read fallback if stored under different table)
143136
found = False

test/core/behaviors/report/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"""
1010

1111
# noqa: F401 — imported for vocabulary registration side-effect
12-
from vultron.wire.as2.vocab.objects.vulnerability_case import (
12+
from vultron.wire.as2.vocab.objects.vulnerability_case import ( # noqa: F401
1313
VulnerabilityCase,
14-
) # noqa: F401
14+
)

test/core/behaviors/report/test_policy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"""
2222

2323
import logging
24-
from unittest.mock import MagicMock
2524

2625
import pytest
2726

test/core/behaviors/test_performance.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,22 @@
2424
import time
2525
from unittest.mock import MagicMock
2626

27-
logger = logging.getLogger(__name__)
28-
2927
import pytest
3028
from py_trees.common import Status
3129

32-
from vultron.core.ports.datalayer import DataLayer
30+
from vultron.core.behaviors.bridge import BTBridge
31+
from vultron.core.behaviors.report.validate_tree import (
32+
create_validate_report_tree,
33+
)
3334
from vultron.core.models.vultron_types import (
3435
VultronAccept,
3536
VultronCase,
3637
VultronCaseActor,
3738
VultronOffer,
3839
VultronReport,
3940
)
40-
from vultron.core.behaviors.bridge import BTBridge
41-
from vultron.core.behaviors.report.validate_tree import (
42-
create_validate_report_tree,
43-
)
41+
42+
logger = logging.getLogger(__name__)
4443

4544

4645
@pytest.fixture

test/core/use_cases/test_actor_use_cases.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import logging
1616
from unittest.mock import MagicMock
1717

18-
import pytest
1918

2019
from vultron.wire.as2.vocab.objects.vulnerability_case import VulnerabilityCase
2120
from vultron.core.use_cases.actor import (

0 commit comments

Comments
 (0)