Files
skill-seekers-reference/src/skill_seekers/cli/parsers/__init__.py
yusyus 83b03d9f9f 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>
2026-02-15 20:20:55 +03:00

81 lines
2.1 KiB
Python

"""Parser registry and factory.
This module registers all subcommand parsers and provides a factory
function to create them.
"""
from .base import SubcommandParser
# Import all parser classes
from .create_parser import CreateParser # NEW: Unified create command
from .config_parser import ConfigParser
from .scrape_parser import ScrapeParser
from .github_parser import GitHubParser
from .pdf_parser import PDFParser
from .unified_parser import UnifiedParser
from .enhance_parser import EnhanceParser
from .enhance_status_parser import EnhanceStatusParser
from .package_parser import PackageParser
from .upload_parser import UploadParser
from .estimate_parser import EstimateParser
from .test_examples_parser import TestExamplesParser
from .install_agent_parser import InstallAgentParser
from .analyze_parser import AnalyzeParser
from .install_parser import InstallParser
from .resume_parser import ResumeParser
from .stream_parser import StreamParser
from .update_parser import UpdateParser
from .multilang_parser import MultilangParser
from .quality_parser import QualityParser
# Registry of all parsers (in order of usage frequency)
PARSERS = [
CreateParser(), # NEW: Unified create command (placed first for prominence)
ConfigParser(),
ScrapeParser(),
GitHubParser(),
PackageParser(),
UploadParser(),
AnalyzeParser(),
EnhanceParser(),
EnhanceStatusParser(),
PDFParser(),
UnifiedParser(),
EstimateParser(),
InstallParser(),
InstallAgentParser(),
TestExamplesParser(),
ResumeParser(),
StreamParser(),
UpdateParser(),
MultilangParser(),
QualityParser(),
]
def register_parsers(subparsers):
"""Register all subcommand parsers.
Args:
subparsers: Subparsers object from main ArgumentParser
Returns:
None
"""
for parser_instance in PARSERS:
parser_instance.create_parser(subparsers)
def get_parser_names():
"""Get list of all subcommand names.
Returns:
List of subcommand names (strings)
"""
return [p.name for p in PARSERS]
__all__ = [
"SubcommandParser",
"PARSERS",
"register_parsers",
"get_parser_names",
]