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:
@@ -155,10 +155,7 @@ def is_valid_url(url, base_url, include_patterns, exclude_patterns):
|
||||
|
||||
# Check include patterns (if specified)
|
||||
if include_patterns:
|
||||
for pattern in include_patterns:
|
||||
if pattern in url:
|
||||
return True
|
||||
return False
|
||||
return any(pattern in url for pattern in include_patterns)
|
||||
|
||||
# If no include patterns, accept by default
|
||||
return True
|
||||
@@ -289,10 +286,7 @@ def list_all_configs():
|
||||
rel_path = config_file.relative_to(config_dir)
|
||||
|
||||
# Category is the first directory in the path, or "root" if in root
|
||||
if len(rel_path.parts) > 1:
|
||||
category = rel_path.parts[0]
|
||||
else:
|
||||
category = "root"
|
||||
category = rel_path.parts[0] if len(rel_path.parts) > 1 else "root"
|
||||
|
||||
if category not in by_category:
|
||||
by_category[category] = []
|
||||
|
||||
Reference in New Issue
Block a user