fix pre-commit go-vet for multi-package layout
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful

The dnephin go-vet hook runs 'go vet' at the repo root, which has no Go files
(all live under cmd/, internal/, pkg/), failing with 'no Go files'. Replace it
with a local 'go vet ./...' hook, mirroring artifactapi.
This commit is contained in:
unkinben
2026-07-05 17:11:55 +10:00
parent 7e9fec60d4
commit 2946db9b49
+13 -1
View File
@@ -6,10 +6,22 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: check-yaml - id: check-yaml
- id: check-added-large-files - id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/dnephin/pre-commit-golang - repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1 rev: v0.5.1
hooks: hooks:
- id: go-fmt - id: go-fmt
- id: go-vet
- id: go-mod-tidy - id: go-mod-tidy
# encapi has no root-level Go files (all under cmd/, internal/, pkg/), so the
# dnephin go-vet hook (which runs `go vet` at the repo root) fails with
# "no Go files". Vet the whole module instead, mirroring artifactapi.
- repo: local
hooks:
- id: go-vet
name: go vet
entry: go vet ./...
language: system
types: [go]
pass_filenames: false