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

@@ -72,20 +72,18 @@ class TestGitHubScraperInitialization(unittest.TestCase):
"""Test initialization with token from environment variable"""
config = {"repo": "facebook/react", "name": "react", "github_token": None}
with patch.dict(os.environ, {"GITHUB_TOKEN": "env_token_456"}):
with patch("skill_seekers.cli.github_scraper.Github") as mock_github:
_scraper = self.GitHubScraper(config)
mock_github.assert_called_once_with("env_token_456")
with patch.dict(os.environ, {"GITHUB_TOKEN": "env_token_456"}), patch("skill_seekers.cli.github_scraper.Github") as mock_github:
_scraper = self.GitHubScraper(config)
mock_github.assert_called_once_with("env_token_456")
def test_init_without_token(self):
"""Test initialization without authentication"""
config = {"repo": "facebook/react", "name": "react", "github_token": None}
with patch("skill_seekers.cli.github_scraper.Github") as mock_github:
with patch.dict(os.environ, {}, clear=True):
scraper = self.GitHubScraper(config)
# Should create unauthenticated client
self.assertIsNotNone(scraper.github)
with patch("skill_seekers.cli.github_scraper.Github"), patch.dict(os.environ, {}, clear=True):
scraper = self.GitHubScraper(config)
# Should create unauthenticated client
self.assertIsNotNone(scraper.github)
def test_token_priority_env_over_config(self):
"""Test that GITHUB_TOKEN env var takes priority over config"""