fix: resolve all CI ruff linting errors (F401, F821, ARG001, SIM117, SIM105, C408)

- Remove unused imports (F401): os/Path/json/threading in tests; os in estimate_pages;
  Path in install_skill; pytest in test_unified_scraper_orchestration
- Fix F821 undefined 'args' in unified_scraper._scrape_local() by storing
  self._cli_args = args in run() and reading via getattr in _scrape_local()
- Fix ARG001/ARG005 unused lambda/function arguments with _ prefix or # noqa:ARG001
  where parameter names must be preserved for keyword-argument compatibility
- Fix C408 unnecessary dict() calls → dict literals in test_enhance_command
- Fix F841 unused variable 'stub' in test_enhance_command
- Fix SIM117 nested with statements → single with in test_unified_scraper_orchestration
- Fix SIM105 try/except/pass → contextlib.suppress in test_unified_scraper_orchestration
- Rewrite TestScrapeLocal to test fixed behavior (not the NameError bug)

All 2267 tests pass, 11 skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-02-22 22:30:52 +03:00
parent f7117c35a9
commit efc722eeed
8 changed files with 89 additions and 94 deletions

View File

@@ -663,7 +663,7 @@ class TestWorkflowJsonConfig:
"""JSON 'workflows' list is used even when args=None."""
captured = {}
def fake_run_workflows(args, context=None):
def fake_run_workflows(args, context=None): # noqa: ARG001
captured["enhance_workflow"] = getattr(args, "enhance_workflow", None)
monkeypatch.setattr(