Develop: Add .golangci.yml and update install-go-tools.sh script

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2025-11-21 08:56:25 +01:00
parent b45abbd0cd
commit 8fc9f807de
2 changed files with 23 additions and 0 deletions

21
.golangci.yml Normal file
View file

@ -0,0 +1,21 @@
version: "2"
linters:
default: standard
# Extra linters that are usually worth the cost even on a big codebase.
enable:
- revive
- gosec
- gocritic # good generic bug/quality suggestions
- misspell # catch obvious spelling mistakes in identifiers/comments
# Linters that tend to fight with established code style or structure:
disable:
- funlen
- gocyclo
- wsl
- lll # don't enforce a strict max line length
- mnd # don't go after every "magic number"
- depguard # only useful once you define strict dependency rules
- gomodguard

View file

@ -44,6 +44,7 @@ case $DESTARCH in
GOBIN="/usr/local/bin" go install github.com/psampaz/go-mod-outdated@latest
GOBIN="/usr/local/bin" go install github.com/kyoh86/richgo@latest
GOBIN="/usr/local/bin" go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
GOBIN="/usr/local/bin" go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
;;
*)
@ -58,6 +59,7 @@ case $DESTARCH in
GOBIN="/usr/local/bin" go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
GOBIN="/usr/local/bin" go install github.com/google/go-licenses@latest
GOBIN="/usr/local/bin" go install github.com/swaggo/swag/cmd/swag@latest
GOBIN="/usr/local/bin" go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
;;
esac