-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
🤖.4372656174656420627920414943726561746564206279204149🪲 enhancementNew feature or requestNew feature or request
Description
Roadmap to Plugin-Based Architecture
Objective
Define and implement a plugin-based architecture for language-specific logic to improve modularity, scalability, and maintainability of the docstring generator.
Goals
- Extract language-specific responsibilities (parsing, comment styles, header handling) into separate plugins.
- Simplify
core.pyto function as a pure orchestrator using a standardized plugin interface. - Maintain shared data structures (
ClassInfo,SignatureInfo) and common utilities incommon.py. - Improve testability by allowing isolated testing of each language plugin.
Phases
Phase 1: Define Plugin Interface
- Introduce
LanguagePlugininterface incommon.pywith methods:get_comment_style() -> CommentStyleparse(lines: List[str]) -> Tuple[List[ClassInfo], List[SignatureInfo]]get_preserved_header_end_line(lines: List[str]) -> intremove_agent_docstring(text: str) -> str
- Document interface contract and update developer guide.
Phase 2: Implement Language Plugins
- Create plugin classes for each supported language:
- Python, Go, Java, Kotlin, JavaScript, TypeScript, C#, C/C++, PowerShell, Delphi.
- Move existing language-specific logic from
core.pyandcommon.pyinto respective plugin implementations. - Register each plugin in a
LANG_PLUGINSregistry keyed by file extension.
Phase 3: Refactor Core Orchestrator
- Replace
EXT_TO_LANGandLANG_PARSERSmaps with the new plugin registry. - Update
process_file()to load and invoke plugin methods exclusively. - Remove all
if language == ...branches fromcore.pyandcommon.py.
Phase 4: Update Common Utilities
- Retain shared data types (
ClassInfo,SignatureInfo) incommon.py. - Optionally move default comment-style configurations into plugins or keep shared defaults.
- Ensure
common.pyonly defines interfaces and general-purpose helpers.
Phase 5: Testing & Validation
- Develop unit tests for each plugin method in isolation.
- Update existing core and integration tests to use the plugin-based workflow.
- Validate end-to-end functionality across all supported languages.
Problem Statement
The current architecture is difficult to support in all languages at the same time.
Priority Level
🫠 Critical - Blocking my workflow completely
Implementation Complexity
- 🤔 Simple - Minor change or addition
- 😑 Moderate - Requires new parsing logic
- 🛠️ Complex - Major feature requiring significant development
- 😎 I don't know
Contribution
- I would like to implement this feature myself
- I can help with testing
- I can provide sample code files for testing
Metadata
Metadata
Assignees
Labels
🤖.4372656174656420627920414943726561746564206279204149🪲 enhancementNew feature or requestNew feature or request