fix: Fix remaining 61 ruff linting errors (SIM102, SIM117)

Fixed all remaining linting errors from the 310 total:
- SIM102: Combined nested if statements (31 errors)
  - adaptors/openai.py
  - config_extractor.py
  - codebase_scraper.py
  - doc_scraper.py
  - github_fetcher.py
  - pattern_recognizer.py
  - pdf_scraper.py
  - test_example_extractor.py

- SIM117: Combined multiple with statements (24 errors)
  - tests/test_async_scraping.py (2 errors)
  - tests/test_github_scraper.py (2 errors)
  - tests/test_guide_enhancer.py (20 errors)

- Fixed test fixture parameter (mock_config in test_c3_integration.py)

All 700+ tests passing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-01-17 23:25:12 +03:00
parent 596b219599
commit 81dd5bbfbc
29 changed files with 720 additions and 360 deletions

View File

@@ -179,11 +179,10 @@ class TestAsyncRouting(unittest.TestCase):
# Mock scrape_all_async to verify it does NOT get called
with patch.object(
converter, "scrape_all_async", new_callable=AsyncMock
) as mock_async:
with patch.object(converter, "_try_llms_txt", return_value=False):
converter.scrape_all()
# Verify async version was NOT called
mock_async.assert_not_called()
) as mock_async, patch.object(converter, "_try_llms_txt", return_value=False):
converter.scrape_all()
# Verify async version was NOT called
mock_async.assert_not_called()
finally:
os.chdir(self.original_cwd)
@@ -317,12 +316,11 @@ class TestAsyncLlmsTxtIntegration(unittest.TestCase):
converter = DocToSkillConverter(config, dry_run=False)
# Mock _try_llms_txt to return True (llms.txt found)
with patch.object(converter, "_try_llms_txt", return_value=True):
with patch.object(converter, "save_summary"):
converter.scrape_all()
# If llms.txt succeeded, async scraping should be skipped
# Verify by checking that pages were not scraped
self.assertEqual(len(converter.visited_urls), 0)
with patch.object(converter, "_try_llms_txt", return_value=True), patch.object(converter, "save_summary"):
converter.scrape_all()
# If llms.txt succeeded, async scraping should be skipped
# Verify by checking that pages were not scraped
self.assertEqual(len(converter.visited_urls), 0)
finally:
os.chdir(original_cwd)