From f1de7ffd18c0fdf7b276c90b74f27e91b392ee85 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 8 Jan 2026 10:14:07 +0200 Subject: [PATCH] fix: golangci-lint config --- .golangci.yml | 47 ++++++++++++++++++++++++----------------------- scripts/check.sh | 4 ++++ 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b96ead8..299e526 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,7 @@ # golangci-lint configuration for Mole # https://golangci-lint.run/usage/configuration/ -version: 2 +version: "2" run: timeout: 5m @@ -17,26 +17,27 @@ linters: - ineffassign - unused -linters-settings: - govet: - enable-all: true - disable: - - fieldalignment # struct field alignment optimization is noisy - errcheck: - exclude-functions: - - (io.Closer).Close - - (*os/exec.Cmd).Run - - (*os/exec.Cmd).Start - staticcheck: - checks: ["all", "-QF1003", "-SA9003"] + settings: + govet: + enable-all: true + disable: + - shadow + - fieldalignment # struct field alignment optimization is noisy + errcheck: + exclude-functions: + - (io.Closer).Close + - (*os/exec.Cmd).Run + - (*os/exec.Cmd).Start + staticcheck: + checks: ["all", "-QF1003", "-SA9003"] -issues: - exclude-rules: - # Ignore certain patterns in test files - - path: _test\.go - linters: - - errcheck - # Ignore errors from os.Remove in cleanup code - - text: "os.Remove" - linters: - - errcheck + exclusions: + rules: + # Ignore certain patterns in test files + - path: _test\.go + linters: + - errcheck + # Ignore errors from os.Remove in cleanup code + - text: "os.Remove" + linters: + - errcheck diff --git a/scripts/check.sh b/scripts/check.sh index a230cf1..4249a82 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -112,6 +112,10 @@ fi echo -e "${YELLOW}3. Running Go linters...${NC}" if command -v golangci-lint > /dev/null 2>&1; then + if ! golangci-lint config verify; then + echo -e "${RED}${ICON_ERROR} golangci-lint config invalid${NC}\n" + exit 1 + fi if golangci-lint run ./cmd/...; then echo -e "${GREEN}${ICON_SUCCESS} golangci-lint passed${NC}\n" else