Skip to content

Commit 508f2d3

Browse files
authored
feat: add golangci-lint linter integration with v2.x support (#51)
* feat: add golangci-lint linter core implementation - Implement Linter interface for golangci-lint - Add binary download and installation from GitHub releases - Support cross-platform detection (Linux, macOS, Windows) - Handle tar.gz and zip extraction based on platform - Implement execution logic with JSON output format - Parse golangci-lint JSON output to Violation structs - Handle exit code 1 as success (violations found) - Create temporary config file management * feat: add golangci-lint rule converter with LLM integration - Implement Converter interface for golangci-lint - Add LLM-based rule to linter mapping - Generate .golangci.yml YAML configuration - Support 9 rule categories (bugs, style, performance, etc.) - Include comprehensive linter list in LLM prompt - Validate linter names and generated configuration * feat: register golangci-lint in global linter registry - Add register.go with init() function - Update bootstrap.go with blank import - Integrate with Symphony CLI linter system * test: add comprehensive unit tests for golangci-lint - Add linter_test.go with platform detection tests - Add parser_test.go with JSON parsing tests - Add converter_test.go with YAML generation tests - Achieve >80% code coverage - Test cross-platform compatibility - Test error handling and edge cases * chore: update dependencies for golangci-lint support - Run go mod tidy - Ensure gopkg.in/yaml.v3 is available * fix: update golangci-lint command format in executor - Change output format flag from --out-format to --format in the golangci-lint command. - Ensure compatibility with the latest golangci-lint version. * refactor: enhance golangci-lint integration with formatter support * style: fix goimports formatting
1 parent de0e003 commit 508f2d3

10 files changed

Lines changed: 1860 additions & 1 deletion

File tree

cmd/sym/bootstrap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
// that registers the linter with the global registry.
77
_ "github.com/DevSymphony/sym-cli/internal/linter/checkstyle"
88
_ "github.com/DevSymphony/sym-cli/internal/linter/eslint"
9+
_ "github.com/DevSymphony/sym-cli/internal/linter/golangcilint"
910
_ "github.com/DevSymphony/sym-cli/internal/linter/pmd"
1011
_ "github.com/DevSymphony/sym-cli/internal/linter/prettier"
1112
_ "github.com/DevSymphony/sym-cli/internal/linter/pylint"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/modelcontextprotocol/go-sdk v1.1.0
1313
github.com/stretchr/testify v1.11.1
1414
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
15+
gopkg.in/yaml.v3 v3.0.1
1516
)
1617

1718
require (
@@ -28,5 +29,4 @@ require (
2829
golang.org/x/oauth2 v0.30.0 // indirect
2930
golang.org/x/sys v0.38.0 // indirect
3031
golang.org/x/text v0.4.0 // indirect
31-
gopkg.in/yaml.v3 v3.0.1 // indirect
3232
)

0 commit comments

Comments
 (0)