fix: resolve all golangci-lint errors and integrate linter into CI/CD, Makefile, and check script
This commit is contained in:
@@ -42,12 +42,16 @@ check:
|
||||
@chmod +x scripts/check.sh
|
||||
@./scripts/check.sh
|
||||
|
||||
## lint: Run gofmt and go vet
|
||||
## lint: Run gofmt, go vet, and golangci-lint
|
||||
lint:
|
||||
@echo "==> Verifying Go formatting..."
|
||||
@test -z "$$(gofmt -l internal/ cmd/)" || (echo "Unformatted files:" && gofmt -l internal/ cmd/ && exit 1)
|
||||
@echo "==> Running Go vet..."
|
||||
@go vet ./...
|
||||
@if command -v golangci-lint &> /dev/null; then \
|
||||
echo "==> Running golangci-lint..."; \
|
||||
golangci-lint run; \
|
||||
fi
|
||||
@echo "✓ Lint passed."
|
||||
|
||||
## format: Format all Go files with gofmt
|
||||
|
||||
Reference in New Issue
Block a user