Add Pylint adapter and refactor adapter architecture#31
Merged
Conversation
- Adapters are now stateless and use CWD at execution time - TSC temp config now uses ToolsDir/.tmp with unique filenames - NewAdapter signature changed from (toolsDir, workDir) to (toolsDir) - Updated all adapter tests accordingly
- Add LinterConverter interface to adapter.go - Rewrite registry.go with Global() singleton, RegisterTool(), GetConverter(), GetConfigFile(), BuildLanguageMapping() - Create adapter/common.go with DefaultToolsDir() - Add register.go to each adapter (eslint, prettier, tsc, checkstyle, pmd) with init() auto-registration - Create bootstrap/adapters.go for blank imports - Update main.go to import bootstrap package - Remove hardcoded languageLinterMapping from converter.go - Remove hardcoded switch in getLinterConverter(), use registry instead - Remove hardcoded switch in getAdapterConfig(), use registry.GetConfigFile() - Change validator.go to use Global() instead of DefaultRegistry() - Add type aliases in linters/interface.go for backward compatibility - Delete registry/init.go to avoid import cycle
…ding Part C: Remove hardcoded linter references - Add GetLLMDescription() method to LinterConverter interface - Update cmd/init.go to dynamically get config files from registry - Update cmd/convert.go to dynamically build --targets flag description - Update converter.go to dynamically build LLM prompts from registry Part D: Move LinterConverters to adapter packages - Create converter.go in each adapter package (eslint, prettier, tsc, checkstyle, pmd) - Update register.go files to use same-package NewConverter() - Delete converter/linters package (eslint.go, prettier_tsc.go, checkstyle.go, pmd.go, interface.go) Registry enhancements: - Add GetAllConfigFiles() method - Add GetAllConverters() method This completes the OCP-compliant adapter architecture: - Adding a new adapter only requires creating files in adapter/<new>/ directory - Plus one blank import line in bootstrap/adapters.go (Go language limitation)
- Implement Pylint adapter with capabilities for Python linting. - Add support for virtual environment management and installation of Pylint. - Create configuration file generation for Pylint using LLM for rule conversion. - Implement tests for adapter functionality, including execution and output parsing. - Update bootstrap to include Pylint adapter registration. This addition enhances the static analysis capabilities of the Symphony CLI for Python projects.
- workDir을 직접 지정할 수 있는 생성자 추가 - symDir은 workDir/.sym으로 자동 설정
- 6개 어댑터(pylint, checkstyle, pmd, eslint, prettier, tsc) 테스트 추가 - testdata 디렉토리에 각 도구별 테스트 파일 및 설정 추가 - init_test.go로 어댑터 등록 처리
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes