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:
@@ -7,7 +7,6 @@ to appropriate scraper while maintaining full backward compatibility.
|
||||
import sys
|
||||
import logging
|
||||
import argparse
|
||||
from typing import List, Optional
|
||||
|
||||
from skill_seekers.cli.source_detector import SourceDetector, SourceInfo
|
||||
from skill_seekers.cli.arguments.create import (
|
||||
@@ -17,7 +16,6 @@ from skill_seekers.cli.arguments.create import (
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CreateCommand:
|
||||
"""Unified create command implementation."""
|
||||
|
||||
@@ -28,7 +26,7 @@ class CreateCommand:
|
||||
args: Parsed command-line arguments
|
||||
"""
|
||||
self.args = args
|
||||
self.source_info: Optional[SourceInfo] = None
|
||||
self.source_info: SourceInfo | None = None
|
||||
|
||||
def execute(self) -> int:
|
||||
"""Execute the create command.
|
||||
@@ -311,7 +309,7 @@ class CreateCommand:
|
||||
finally:
|
||||
sys.argv = original_argv
|
||||
|
||||
def _add_common_args(self, argv: List[str]) -> None:
|
||||
def _add_common_args(self, argv: list[str]) -> None:
|
||||
"""Add common/universal arguments to argv list.
|
||||
|
||||
Args:
|
||||
@@ -367,7 +365,6 @@ class CreateCommand:
|
||||
if getattr(self.args, 'interactive_enhancement', False):
|
||||
argv.append('--interactive-enhancement')
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""Entry point for create command.
|
||||
|
||||
@@ -510,6 +507,5 @@ Common Workflows:
|
||||
command = CreateCommand(args)
|
||||
return command.execute()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user