Skip to content

Commit b125848

Browse files
Copilotnotfolder
andcommitted
Add targeted noqa comments for PLC0415 and S603 lint errors
Co-authored-by: notfolder <20558197+notfolder@users.noreply.github.com>
1 parent 5316903 commit b125848

7 files changed

Lines changed: 29 additions & 26 deletions

File tree

handlers/task_getter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def factory(
2222
) -> TaskGetterFromGitHub | TaskGetterFromGitLab:
2323
# Import here to avoid circular import issues - this is a legitimate use case
2424
if task_source == "github":
25-
from .task_getter_github import TaskGetterFromGitHub
25+
from .task_getter_github import TaskGetterFromGitHub # noqa: PLC0415
2626
return TaskGetterFromGitHub(config, mcp_clients)
2727
if task_source == "gitlab":
28-
from .task_getter_gitlab import TaskGetterFromGitLab
28+
from .task_getter_gitlab import TaskGetterFromGitLab # noqa: PLC0415
2929
return TaskGetterFromGitLab(config, mcp_clients)
3030
msg = f"Unknown task_source: {task_source}"
3131
raise ValueError(msg)

tests/integration/test_simple_workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
def _import_test_modules() -> tuple[type, type, type, type]:
1717
"""Import test modules after mocking is set up."""
18-
from handlers.task_getter_github import TaskGitHubIssue
19-
from handlers.task_handler import TaskHandler
20-
from tests.mocks.mock_llm_client import MockLLMClient
21-
from tests.mocks.mock_mcp_client import MockMCPToolClient
18+
from handlers.task_getter_github import TaskGitHubIssue # noqa: PLC0415
19+
from handlers.task_handler import TaskHandler # noqa: PLC0415
20+
from tests.mocks.mock_llm_client import MockLLMClient # noqa: PLC0415
21+
from tests.mocks.mock_mcp_client import MockMCPToolClient # noqa: PLC0415
2222
return TaskGitHubIssue, TaskHandler, MockLLMClient, MockMCPToolClient
2323

2424

tests/integration/test_workflow.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@
2121

2222
def _import_test_modules() -> tuple[type, ...]:
2323
"""Import test modules after mocking is set up."""
24-
from handlers.task_factory import GitHubTaskFactory, GitLabTaskFactory
25-
from handlers.task_getter_github import TaskGetterFromGitHub, TaskGitHubIssue
26-
from handlers.task_getter_gitlab import TaskGetterFromGitLab, TaskGitLabIssue
27-
from handlers.task_handler import TaskHandler
28-
from handlers.task_key import GitHubIssueTaskKey, GitLabIssueTaskKey
29-
from tests.mocks.mock_llm_client import MockLLMClient, MockLLMClientWithToolCalls
30-
from tests.mocks.mock_mcp_client import MockMCPToolClient
24+
from handlers.task_factory import GitHubTaskFactory, GitLabTaskFactory # noqa: PLC0415
25+
from handlers.task_getter_github import TaskGetterFromGitHub, TaskGitHubIssue # noqa: PLC0415
26+
from handlers.task_getter_gitlab import TaskGetterFromGitLab, TaskGitLabIssue # noqa: PLC0415
27+
from handlers.task_handler import TaskHandler # noqa: PLC0415
28+
from handlers.task_key import GitHubIssueTaskKey, GitLabIssueTaskKey # noqa: PLC0415
29+
from tests.mocks.mock_llm_client import ( # noqa: PLC0415
30+
MockLLMClient,
31+
MockLLMClientWithToolCalls,
32+
)
33+
from tests.mocks.mock_mcp_client import MockMCPToolClient # noqa: PLC0415
3134

3235
return (
3336
GitHubTaskFactory, GitLabTaskFactory, TaskGetterFromGitHub, TaskGitHubIssue,

tests/real_integration/base_framework.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def run_coding_agent(self, timeout: int = 300) -> subprocess.CompletedProcess:
226226
# コーディングエージェントを実行
227227
agent_path = Path(__file__).parent.parent.parent / "main.py"
228228

229-
result = subprocess.run(
229+
result = subprocess.run( # noqa: S603
230230
[sys.executable, str(agent_path)],
231231
check=False,
232232
env=env,
@@ -291,7 +291,7 @@ def verify_python_execution(self, file_path: str, expected_output: str) -> bool:
291291
tmp_path = tmp.name
292292

293293
try:
294-
result = subprocess.run(
294+
result = subprocess.run( # noqa: S603
295295
[sys.executable, tmp_path],
296296
check=False,
297297
capture_output=True,

tests/real_integration/check_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def check_mcp_servers() -> bool:
129129

130130
# This subprocess call is safe: using validated npm command with fixed arguments
131131
npm_args = [npm_cmd, "list", "@zereight/mcp-gitlab"]
132-
result = subprocess.run(
132+
result = subprocess.run( # noqa: S603
133133
npm_args,
134134
check=False,
135135
capture_output=True,

tests/real_integration/demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_config_check() -> bool:
4242
try:
4343
# Safe subprocess call: using sys.executable and hardcoded script path
4444
demo_args = [sys.executable, "tests/real_integration/check_config.py"]
45-
result = subprocess.run(
45+
result = subprocess.run( # noqa: S603
4646
demo_args,
4747
check=False,
4848
capture_output=True,
@@ -67,7 +67,7 @@ def run_mock_tests() -> bool:
6767
try:
6868
# Safe subprocess call: using sys.executable and hardcoded script path
6969
test_args = [sys.executable, "tests/run_tests.py", "--mock"]
70-
result = subprocess.run(
70+
result = subprocess.run( # noqa: S603
7171
test_args,
7272
check=False,
7373
capture_output=True,
@@ -95,7 +95,7 @@ def run_real_tests() -> bool:
9595
try:
9696
# Safe subprocess call: using sys.executable and hardcoded script path
9797
real_test_args = [sys.executable, "tests/run_tests.py", "--real"]
98-
result = subprocess.run(
98+
result = subprocess.run( # noqa: S603
9999
real_test_args,
100100
check=False,
101101
text=True,

tests/unit/test_task_handler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919

2020
def _import_test_modules() -> tuple[type, ...]:
2121
"""Import test modules after mocking is set up."""
22-
import pytest
23-
from mcp import McpError
22+
import pytest # noqa: PLC0415
23+
from mcp import McpError # noqa: PLC0415
2424

25-
from handlers.task_getter_github import TaskGitHubIssue
26-
from handlers.task_getter_gitlab import TaskGitLabIssue
27-
from handlers.task_handler import TaskHandler
28-
from tests.mocks.mock_llm_client import (
25+
from handlers.task_getter_github import TaskGitHubIssue # noqa: PLC0415
26+
from handlers.task_getter_gitlab import TaskGitLabIssue # noqa: PLC0415
27+
from handlers.task_handler import TaskHandler # noqa: PLC0415
28+
from tests.mocks.mock_llm_client import ( # noqa: PLC0415
2929
MockLLMClient,
3030
MockLLMClientWithErrors,
3131
MockLLMClientWithToolCalls,
3232
)
33-
from tests.mocks.mock_mcp_client import MockMCPToolClient
33+
from tests.mocks.mock_mcp_client import MockMCPToolClient # noqa: PLC0415
3434

3535
return (pytest, McpError, TaskGitHubIssue, TaskGitLabIssue, TaskHandler,
3636
MockLLMClient, MockLLMClientWithErrors, MockLLMClientWithToolCalls,

0 commit comments

Comments
 (0)