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:
yusyus
2026-02-15 20:20:55 +03:00
parent 4c6d885725
commit 83b03d9f9f
45 changed files with 134 additions and 270 deletions

View File

@@ -7,13 +7,12 @@ local directory, PDF file, or config file based on patterns.
import os
import re
from dataclasses import dataclass
from typing import Dict, Any, Optional
from typing import Any
from urllib.parse import urlparse
import logging
logger = logging.getLogger(__name__)
@dataclass
class SourceInfo:
"""Information about a detected source.
@@ -25,11 +24,10 @@ class SourceInfo:
raw_input: Original user input
"""
type: str
parsed: Dict[str, Any]
parsed: dict[str, Any]
suggested_name: str
raw_input: str
class SourceDetector:
"""Detects source type from user input and extracts relevant information."""
@@ -124,7 +122,7 @@ class SourceDetector:
)
@classmethod
def _detect_github(cls, source: str) -> Optional[SourceInfo]:
def _detect_github(cls, source: str) -> SourceInfo | None:
"""Detect GitHub repository source.
Supports patterns: