refactor: use official golangci-lint image for lint stage

Restructure Dockerfile to match upaas/dnswatcher pattern:
- Separate lint stage using golangci/golangci-lint:v2.1.6 image
- Builder stage for tests and compilation (no lint dependency)
- Add fmt-check Makefile target
- Decouple test from lint in Makefile (lint runs in its own stage)
- Run gofmt on all files
- docker build verified passing locally
This commit is contained in:
clawbot
2026-03-10 12:36:19 -07:00
parent a8ce1ff7c8
commit 7b84aa345f
4 changed files with 29 additions and 39 deletions

View File

@@ -17,7 +17,7 @@ build: ./secret
vet:
go vet ./...
test: lint vet
test: vet
go test ./... || go test -v ./...
fmt:
@@ -26,7 +26,7 @@ fmt:
lint:
golangci-lint run --timeout 5m
check: build test
check: build lint test
# Build Docker container
docker:
@@ -42,3 +42,6 @@ clean:
install: ./secret
cp ./secret $(HOME)/bin/secret
fmt-check:
@test -z "$$(gofmt -l .)" || (echo "Files need formatting:" && gofmt -l . && exit 1)