feat: convert convention and validation with llm#8
Conversation
- Remove fallback inference logic (fail fast on LLM errors) - Remove conversion report generation - Remove verbose logging from converter - Add validation scripts for eslint and checkstyle - Add linter validation documentation - Simplify converter interface (remove verbose parameter) - Reduce inference.go from 311 to 160 lines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…s and improvements
…ds in init function
…oved error handling
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive E2E testing infrastructure and multi-target linter conversion capabilities to Symphony CLI. It introduces LLM-powered validation for complex coding conventions, automated conversion of natural language policies to multiple linter configurations (ESLint, Checkstyle, PMD), and extensive test coverage for the validation workflow.
- LLM-powered validator for code changes using OpenAI API
- Multi-target converter supporting ESLint, Checkstyle, and PMD with intelligent rule inference
- Comprehensive E2E and unit tests covering validation, conversion, and MCP integration workflows
Reviewed Changes
Copilot reviewed 37 out of 39 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/validator_test.go | E2E tests for LLM validator with policy loading and code validation |
| tests/e2e/unit_workflow_test.go | Unit tests for policy parsing, diff extraction, and workflow steps |
| tests/e2e/mcp_integration_test.go | MCP integration tests for convention queries and AI code validation |
| tests/e2e/full_workflow_test.go | Full workflow tests from policy creation to validation |
| tests/e2e/examples/*.js | Good and bad code examples for validation testing |
| internal/validator/*.go | LLM validator implementation with git diff extraction |
| internal/llm/*.go | LLM client and inference engine for rule analysis |
| internal/converter/linters/*.go | Multi-linter converters (ESLint, Checkstyle, PMD) |
| internal/cmd/*.go | Enhanced CLI commands for convert, validate, and MCP |
| docs/*.md | Comprehensive documentation for features and usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,202 @@ | |||
| package e2e_test | |||
|
|
|||
There was a problem hiding this comment.
Line 109 contains a malformed diff header. The line number '0' is invalid - it should start at 1. This will cause the diff extraction to fail.
| @@ -0,0 +1,60 @@ | |||
| package validator | |||
|
|
|||
There was a problem hiding this comment.
Line 17 contains a malformed diff header with line number '0' instead of a valid line number. This will break diff parsing and should be corrected to match the actual diff format.
| @@ -0,0 +1,146 @@ | |||
| package validator | |||
|
|
|||
There was a problem hiding this comment.
Line 12 has an invalid diff header with line number '0'. Diff headers should have valid line numbers starting from 1, otherwise the ExtractAddedLines function may not work correctly.
| @@ -0,0 +1,60 @@ | |||
| package validator | |||
|
|
|||
There was a problem hiding this comment.
Another occurrence of invalid line number '0' in diff header at line 29. This pattern appears multiple times and should be fixed to ensure proper diff parsing.
| @@ -0,0 +1,60 @@ | |||
| package validator | |||
|
|
|||
There was a problem hiding this comment.
Invalid line number '0' in diff header at line 48. This should use a valid line number to represent the proper git diff format.
|
|
||
| // GOOD: STYLE-002 - Consistent single quotes | ||
| const message = 'Hello, World!'; | ||
| const greeting = 'Welcome'; |
There was a problem hiding this comment.
Unused variable greeting.
| const greeting = 'Welcome'; | ||
|
|
||
| // GOOD: STYLE-003 - Using const for non-reassigned variables | ||
| function processItems(items) { |
There was a problem hiding this comment.
Unused function processItems.
| } | ||
|
|
||
| // GOOD: PERF-001 - Using async/await instead of nested promises | ||
| async function getUserProfile(userId) { |
There was a problem hiding this comment.
Unused function getUserProfile.
| // GOOD: SEC-003 - Sanitizing HTML before rendering | ||
| import DOMPurify from 'dompurify'; | ||
|
|
||
| function SafeComponent({ htmlContent }) { |
There was a problem hiding this comment.
Unused function SafeComponent.
| } | ||
|
|
||
| // UI component with minimal logic | ||
| function UserDashboard({ userId }) { |
There was a problem hiding this comment.
Unused function UserDashboard.
…mphony/sym-cli into feature/convert-convention
8cf56f4 to
a0d85ff
Compare
1. Convert: 자연어 → Linter 설정 자동 변환
2. Validate: LLM 기반 코드 검증
3. MCP 서버 자동 설정
query_conventions,validate_code도구 제공