ci: add golangci-lint with config and fixes#9
Merged
Neo23x0 merged 5 commits intoNextron-Labs:masterfrom Mar 17, 2026
Merged
Conversation
added 5 commits
March 17, 2026 22:44
Enable core linters for code quality: - errcheck: unchecked error returns - govet: Go vet analysis - staticcheck: static analysis - gosimple: code simplifications - unused: find unused code - ineffassign: detect ineffectual assignments - misspell: spelling mistakes - gofumpt: stricter gofmt - revive: fast, configurable linter - gocritic: extensible linter - gocyclo: cyclomatic complexity (threshold: 50) Exclusions: - errcheck disabled for test files (common pattern) - Close/RemoveAll/SetDeadline errors excluded (best-effort cleanup) - Generated eBPF files excluded from unused/govet - gofumpt deferred to separate PR (existing formatting) - Various gocritic style checks excluded for gradual adoption
- cmd/aurora/agent/agent.go: Mark AddSource() error returns as intentionally ignored (errors are checked during subsequent Initialize() call) - cmd/aurora-util/main.go:337: Replace if+TrimSuffix with unconditional strings.TrimSuffix (gosimple S1017) - cmd/aurora-util/main.go:613,726: Replace deprecated tar.TypeRegA with tar.TypeReg (staticcheck SA1019, deprecated since Go 1.11) - lib/provider/ebpf/listener.go:32: Remove unused sync.Mutex field
Add dedicated lint job using golangci/golangci-lint-action@v6: - Runs on ubuntu-24.04 (no matrix needed for linting) - Installs BPF dependencies (required for eBPF code compilation) - Generates eBPF bindings before linting - Uses golangci-lint v1.64 with 5m timeout Lint job runs independently alongside the test matrix.
The function was defined but never called in production code, causing the 'unused' linter to fail in CI.
- Remove compiled aurora/aurora-util binaries - Remove generated eBPF files (vmlinux.h, *_bpfel.go, *_bpfel.o) - Update .gitignore to prevent future commits of these files
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
Adds golangci-lint to the CI pipeline with a sensible configuration and resolves all existing lint warnings.
Linters Enabled
Core linters:
errcheck- unchecked error returnsgovet- Go vet analysisstaticcheck- static analysisgosimple- code simplificationsunused- find unused codeineffassign- detect ineffectual assignmentsAdditional quality linters:
misspell- spelling mistakesgofumpt- stricter gofmt (deferred, existing code excluded)revive- fast, configurable lintergocritic- extensible lintergocyclo- cyclomatic complexity (threshold: 50)Production Code Fixes
AddSource()error returns (checked during Initialize)strings.TrimSuffix(gosimple S1017)tar.TypeRegAwithtar.TypeReg(staticcheck SA1019)sync.MutexfieldConfiguration Highlights
errcheckdisabled in test files (common pattern to ignore errors in tests)gofumptformatting deferred to a separate PR (would touch entire codebase)CI Integration
New
lintjob inpackage-ci.yml:golangci/golangci-lint-action@v6The lint job runs independently alongside the existing test matrix.