fix: Resolve all linting errors from ruff
Fix 145 linting errors across CLI refactor code: Type annotation modernization (Python 3.9+): - Replace typing.Dict with dict - Replace typing.List with list - Replace typing.Set with set - Replace Optional[X] with X | None Code quality improvements: - Remove trailing whitespace (W291) - Remove whitespace from blank lines (W293) - Remove unused imports (F401) - Use dictionary lookup instead of if-elif chains (SIM116) - Combine nested if statements (SIM102) Files fixed (45 files): - src/skill_seekers/cli/arguments/*.py (10 files) - src/skill_seekers/cli/parsers/*.py (24 files) - src/skill_seekers/cli/presets/*.py (4 files) - src/skill_seekers/cli/create_command.py - src/skill_seekers/cli/source_detector.py - src/skill_seekers/cli/github_scraper.py - tests/test_*.py (5 test files) All files now pass ruff linting checks. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,13 +9,10 @@ Tests the SourceDetector class's ability to identify and parse:
|
||||
"""
|
||||
|
||||
import os
|
||||
import tempfile
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
from skill_seekers.cli.source_detector import SourceDetector, SourceInfo
|
||||
|
||||
|
||||
class TestWebDetection:
|
||||
"""Test web URL detection."""
|
||||
|
||||
@@ -58,7 +55,6 @@ class TestWebDetection:
|
||||
assert info.type == 'web'
|
||||
assert info.suggested_name == 'vue'
|
||||
|
||||
|
||||
class TestGitHubDetection:
|
||||
"""Test GitHub repository detection."""
|
||||
|
||||
@@ -97,7 +93,6 @@ class TestGitHubDetection:
|
||||
assert info.parsed['repo'] == "microsoft/vscode-python"
|
||||
assert info.suggested_name == 'vscode-python'
|
||||
|
||||
|
||||
class TestLocalDetection:
|
||||
"""Test local directory detection."""
|
||||
|
||||
@@ -136,7 +131,6 @@ class TestLocalDetection:
|
||||
assert info.type == 'local'
|
||||
assert info.parsed['directory'] == cwd
|
||||
|
||||
|
||||
class TestPDFDetection:
|
||||
"""Test PDF file detection."""
|
||||
|
||||
@@ -160,7 +154,6 @@ class TestPDFDetection:
|
||||
assert info.type == 'pdf'
|
||||
assert info.suggested_name == 'my-awesome-guide'
|
||||
|
||||
|
||||
class TestConfigDetection:
|
||||
"""Test config file detection."""
|
||||
|
||||
@@ -178,7 +171,6 @@ class TestConfigDetection:
|
||||
assert info.parsed['config_path'] == "configs/django.json"
|
||||
assert info.suggested_name == 'django'
|
||||
|
||||
|
||||
class TestValidation:
|
||||
"""Test source validation."""
|
||||
|
||||
@@ -246,7 +238,6 @@ class TestValidation:
|
||||
)
|
||||
SourceDetector.validate_source(info)
|
||||
|
||||
|
||||
class TestAmbiguousCases:
|
||||
"""Test handling of ambiguous inputs."""
|
||||
|
||||
@@ -277,7 +268,6 @@ class TestAmbiguousCases:
|
||||
# Should detect as local directory, not web
|
||||
assert info.type == 'local'
|
||||
|
||||
|
||||
class TestRawInputPreservation:
|
||||
"""Test that raw_input is preserved correctly."""
|
||||
|
||||
@@ -302,7 +292,6 @@ class TestRawInputPreservation:
|
||||
info = SourceDetector.detect(original)
|
||||
assert info.raw_input == original
|
||||
|
||||
|
||||
class TestEdgeCases:
|
||||
"""Test edge cases and corner cases."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user