fix: resolve all ruff linting errors (W293, F401, B904, UP007, UP045, E741, SIM102, SIM117, ARG)

Auto-fixed (whitespace, imports, type annotations):
- codebase_scraper.py: W293 blank lines with whitespace
- doc_scraper.py: W293 blank lines with whitespace
- parsers/extractors/__init__.py: W293
- parsers/extractors/base_parser.py: W293, UP007, UP045, F401

Manual fixes:
- enhancement_workflow.py: B904 raise without `from exc`, remove unused `os` import
- parsers/extractors/quality_scorer.py: E741 ambiguous var `l` → `line`
- parsers/extractors/rst_parser.py: SIM102 nested if → combined conditions (x2)
- pdf_scraper.py: F821 undefined `logger` → `print()` (consistent with file style)
- mcp/tools/workflow_tools.py: ARG001 unused `args` → `_args`
- tests/test_workflow_runner.py: ARG005 unused lambda args → `_a`/`_kw`, ARG001 `kwargs` → `_kwargs`
- tests/test_workflows_command.py: SIM117 nested with → combined with (x2)

All 1922 tests pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-02-18 22:44:41 +03:00
parent c44b88e801
commit 0878ad3ef6
20 changed files with 657 additions and 695 deletions

View File

@@ -12,8 +12,7 @@ Covers:
"""
import argparse
import sys
from unittest.mock import MagicMock, patch, call
from unittest.mock import MagicMock, patch
import pytest
@@ -186,7 +185,7 @@ class TestRunWorkflowsMultiple:
m.workflow.description = "desc"
m.workflow.stages = []
# Track call order
m.run.side_effect = lambda *a, _n=wf_name, **kw: run_order.append(_n)
m.run.side_effect = lambda *_a, _n=wf_name, **_kw: run_order.append(_n)
engines.append(m)
with patch(
@@ -208,7 +207,7 @@ class TestRunWorkflowsMultiple:
good_engine.workflow.description = "desc"
good_engine.workflow.stages = []
def side_effect(name, **kwargs):
def side_effect(name, **_kwargs):
if name == "bad-workflow":
raise FileNotFoundError("not found")
return good_engine
@@ -341,9 +340,8 @@ class TestRunWorkflowsDryRun:
with patch(
"skill_seekers.cli.enhancement_workflow.WorkflowEngine",
return_value=mock_engine,
):
with pytest.raises(SystemExit) as exc:
run_workflows(args)
), pytest.raises(SystemExit) as exc:
run_workflows(args)
assert exc.value.code == 0
mock_engine.preview.assert_called_once()
@@ -366,9 +364,8 @@ class TestRunWorkflowsDryRun:
with patch(
"skill_seekers.cli.enhancement_workflow.WorkflowEngine",
side_effect=engines,
):
with pytest.raises(SystemExit):
run_workflows(args)
), pytest.raises(SystemExit):
run_workflows(args)
for engine in engines:
engine.preview.assert_called_once()