Skip to content

feat: add golangci-lint linter integration with v2.x support#51

Merged
ikjeong merged 8 commits intoDevSymphony:mainfrom
yessjun:feat/add-golangci-lint-linter
Dec 12, 2025
Merged

feat: add golangci-lint linter integration with v2.x support#51
ikjeong merged 8 commits intoDevSymphony:mainfrom
yessjun:feat/add-golangci-lint-linter

Conversation

@yessjun
Copy link
Contributor

@yessjun yessjun commented Dec 12, 2025

Summary

  • Go 코드 품질 검증을 위한 golangci-lint 린터 통합 추가

Changes

  • internal/linter/golangcilint/ 패키지 신규 생성
    • linter.go: GitHub releases에서 바이너리 다운로드/설치, 크로스 플랫폼 지원 (Linux, macOS, Windows)
    • executor.go: golangci-lint v2.x CLI 실행 (--output.json.path, --show-stats=false, ./... 패턴)
    • parser.go: JSON 출력 파싱 및 Violation 구조체 변환
    • converter.go: LLM 기반 규칙→린터 매핑, v2.x formatters/linters 분리 지원
    • register.go: 글로벌 린터 레지스트리 등록
  • golangci-lint v2.x 호환성 처리
    • Formatters (gofmt, goimports 등)와 Linters 섹션 분리
    • --format 플래그 대신 --output.json.path stdout 사용
    • 개별 파일 인자 대신 ./... 패턴 사용 후 결과 필터링
  • 파일 경로 매칭 로직 개선 (상대 경로 ../../../ 처리)
  • 단위 테스트 추가 (linter_test.go, parser_test.go, converter_test.go)

- 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
- 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
- Add register.go with init() function
- Update bootstrap.go with blank import
- Integrate with Symphony CLI linter system
- 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
- Run go mod tidy
- Ensure gopkg.in/yaml.v3 is available
- Change output format flag from --out-format to --format in the golangci-lint command.
- Ensure compatibility with the latest golangci-lint version.
@ikjeong ikjeong requested review from ikjeong and sehwan505 December 12, 2025 04:19
Copy link
Contributor

@sehwan505 sehwan505 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금 lint가 안맞아요. 이외에는 LGTM

Copy link
Contributor

@ikjeong ikjeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ikjeong ikjeong merged commit 508f2d3 into DevSymphony:main Dec 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants