mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 11:31:46 +00:00
fix: golangci-lint config
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# golangci-lint configuration for Mole
|
# golangci-lint configuration for Mole
|
||||||
# https://golangci-lint.run/usage/configuration/
|
# https://golangci-lint.run/usage/configuration/
|
||||||
|
|
||||||
version: 2
|
version: "2"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
@@ -17,10 +17,11 @@ linters:
|
|||||||
- ineffassign
|
- ineffassign
|
||||||
- unused
|
- unused
|
||||||
|
|
||||||
linters-settings:
|
settings:
|
||||||
govet:
|
govet:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
|
- shadow
|
||||||
- fieldalignment # struct field alignment optimization is noisy
|
- fieldalignment # struct field alignment optimization is noisy
|
||||||
errcheck:
|
errcheck:
|
||||||
exclude-functions:
|
exclude-functions:
|
||||||
@@ -30,8 +31,8 @@ linters-settings:
|
|||||||
staticcheck:
|
staticcheck:
|
||||||
checks: ["all", "-QF1003", "-SA9003"]
|
checks: ["all", "-QF1003", "-SA9003"]
|
||||||
|
|
||||||
issues:
|
exclusions:
|
||||||
exclude-rules:
|
rules:
|
||||||
# Ignore certain patterns in test files
|
# Ignore certain patterns in test files
|
||||||
- path: _test\.go
|
- path: _test\.go
|
||||||
linters:
|
linters:
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ fi
|
|||||||
|
|
||||||
echo -e "${YELLOW}3. Running Go linters...${NC}"
|
echo -e "${YELLOW}3. Running Go linters...${NC}"
|
||||||
if command -v golangci-lint > /dev/null 2>&1; then
|
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
|
if golangci-lint run ./cmd/...; then
|
||||||
echo -e "${GREEN}${ICON_SUCCESS} golangci-lint passed${NC}\n"
|
echo -e "${GREEN}${ICON_SUCCESS} golangci-lint passed${NC}\n"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user