Skip to content

Commit 8d11800

Browse files
fix: resolve ruff lint errors causing CI failure
Agent-Logs-Url: https://github.com/SummerOneTwo/AutoCode/sessions/19d466ad-96c0-4698-97c3-ab82894be926 Co-authored-by: SummerOneTwo <89140025+SummerOneTwo@users.noreply.github.com>
1 parent df8a625 commit 8d11800

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/autocode_mcp/tools/validation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def _compare_output(self, actual: str, expected: str, tolerance: float) -> bool:
316316
if len(actual_tokens) == len(expected_tokens):
317317
actual_nums = [float(x) for x in actual_tokens]
318318
expected_nums = [float(x) for x in expected_tokens]
319-
return all(abs(a - e) < tolerance for a, e in zip(actual_nums, expected_nums))
319+
return all(abs(a - e) < tolerance for a, e in zip(actual_nums, expected_nums, strict=False))
320320
except ValueError:
321321
pass
322322

@@ -364,7 +364,7 @@ def _extract_samples_from_readme(self, readme_path: str) -> list[dict]:
364364
output_blocks = re.findall(pattern, content, re.DOTALL | re.IGNORECASE)
365365

366366
# 配对
367-
for i, (inp, out) in enumerate(zip(input_blocks, output_blocks)):
367+
for _i, (inp, out) in enumerate(zip(input_blocks, output_blocks, strict=False)):
368368
samples.append({
369369
"input": inp.strip(),
370370
"expected_output": out.strip(),
@@ -392,10 +392,10 @@ def _extract_samples_from_readme(self, readme_path: str) -> list[dict]:
392392
inputs = re.findall(input_pattern, content, re.DOTALL | re.IGNORECASE)
393393
outputs = re.findall(output_pattern, content, re.DOTALL | re.IGNORECASE)
394394

395-
for inp, out in zip(inputs, outputs):
395+
for inp, out in zip(inputs, outputs, strict=False):
396396
samples.append({
397397
"input": inp.strip(),
398398
"expected_output": out.strip(),
399399
})
400400

401-
return samples
401+
return samples

tests/test_validation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import os
88
import tempfile
99

10-
import pytest
11-
1210
from autocode_mcp.tools.validation import ProblemValidateTool
1311

1412

0 commit comments

Comments
 (0)