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

@@ -21,7 +21,7 @@ import os
import re
import sys
from pathlib import Path
from typing import Any, Optional
from typing import Any
try:
from github import Github, GithubException, Repository
@@ -100,7 +100,6 @@ EXCLUDED_DIRS = {
".tmp",
}
def extract_description_from_readme(readme_content: str, repo_name: str) -> str:
"""
Extract a meaningful description from README content for skill description.
@@ -181,7 +180,6 @@ def extract_description_from_readme(readme_content: str, repo_name: str) -> str:
project_name = repo_name.split("/")[-1]
return f"Use when working with {project_name}"
class GitHubScraper:
"""
GitHub Repository Scraper (C1.1-C1.9)
@@ -563,7 +561,7 @@ class GitHubScraper:
return False
def _load_gitignore(self) -> Optional["pathspec.PathSpec"]:
def _load_gitignore(self) -> "pathspec.PathSpec" | None:
"""
Load .gitignore file and create pathspec matcher (C2.1).
@@ -894,7 +892,6 @@ class GitHubScraper:
logger.info(f"Data saved to: {self.data_file}")
class GitHubToSkillConverter:
"""
Convert extracted GitHub data to Claude skill format (C1.10).
@@ -1350,14 +1347,13 @@ Use this skill when you need to:
f.write(content)
logger.info(f"Generated: {structure_path}")
def setup_argument_parser() -> argparse.ArgumentParser:
"""Setup and configure command-line argument parser.
Creates an ArgumentParser with all CLI options for the github scraper.
All arguments are defined in skill_seekers.cli.arguments.github to ensure
consistency between the standalone scraper and unified CLI.
Returns:
argparse.ArgumentParser: Configured argument parser
"""
@@ -1378,7 +1374,6 @@ Examples:
return parser
def main():
"""C1.10: CLI tool entry point."""
parser = setup_argument_parser()
@@ -1476,6 +1471,5 @@ def main():
logger.error(f"Error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()