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

@@ -431,16 +431,15 @@ class TestInstallAgentCLI:
with patch(
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
), patch(
"sys.argv",
["install_agent.py", str(self.skill_dir), "--agent", "claude", "--dry-run"],
):
with patch(
"sys.argv",
["install_agent.py", str(self.skill_dir), "--agent", "claude", "--dry-run"],
):
exit_code = main()
exit_code = main()
assert exit_code == 0
# Directory should NOT be created
assert not (Path(agent_tmpdir) / ".claude" / "skills" / "test-skill").exists()
assert exit_code == 0
# Directory should NOT be created
assert not (Path(agent_tmpdir) / ".claude" / "skills" / "test-skill").exists()
def test_cli_integration(self):
"""Test end-to-end CLI execution."""
@@ -451,18 +450,17 @@ class TestInstallAgentCLI:
with patch(
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
), patch(
"sys.argv",
["install_agent.py", str(self.skill_dir), "--agent", "claude", "--force"],
):
with patch(
"sys.argv",
["install_agent.py", str(self.skill_dir), "--agent", "claude", "--force"],
):
exit_code = main()
exit_code = main()
assert exit_code == 0
# Directory should be created
target = Path(agent_tmpdir) / ".claude" / "skills" / "test-skill"
assert target.exists()
assert (target / "SKILL.md").exists()
assert exit_code == 0
# Directory should be created
target = Path(agent_tmpdir) / ".claude" / "skills" / "test-skill"
assert target.exists()
assert (target / "SKILL.md").exists()
def test_cli_install_to_all(self):
"""Test CLI with --agent all."""
@@ -473,19 +471,18 @@ class TestInstallAgentCLI:
with patch(
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
), patch(
"sys.argv",
["install_agent.py", str(self.skill_dir), "--agent", "all", "--force"],
):
with patch(
"sys.argv",
["install_agent.py", str(self.skill_dir), "--agent", "all", "--force"],
):
exit_code = main()
exit_code = main()
assert exit_code == 0
assert exit_code == 0
# All agent directories should be created
for agent in get_available_agents():
target = Path(agent_tmpdir) / f".{agent}" / "skills" / "test-skill"
assert target.exists(), f"Directory not created for {agent}"
# All agent directories should be created
for agent in get_available_agents():
target = Path(agent_tmpdir) / f".{agent}" / "skills" / "test-skill"
assert target.exists(), f"Directory not created for {agent}"
if __name__ == "__main__":