Files
nomad/.golangci.yml
James Rasell 270ab1011e lint: Enable and fix SA9004 constant type lint errors. (#26678)
When creating constants with a custom type, each definition should
include the type definition. If only the first constant defines
this, it will have a different type to the other constants.

This change fixes occurances of this and enables SA9004 within CI
linting to catch future problems while the change is in review.
2025-09-03 07:45:29 +01:00

85 lines
1.6 KiB
YAML

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
version: "2"
run:
timeout: 10m
# Modules download mode (do not modify go.mod)
modules-download-mode: readonly
# Exclude test files
tests: false
output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- dogsled
- durationcheck
- gocritic
- govet
- ineffassign
- misspell
- staticcheck
- unconvert
- usestdlibvars
settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
exclude-functions:
- io.*
- fmt.*
gocritic:
disabled-checks:
- commentFormatting
- deprecatedComment
govet:
disable:
- shadow
staticcheck:
checks:
- SA4029
- SA5008
- SA9004
- ST1016
- ST1020
exclusions:
rules:
- path: (.+)\.go$
text: ifElseChain
- path: (.+)\.go$
text: singleCaseSwitch
- path: (.+)\.go$
text: assignOp
- path: (.+)\.go$
text: unlambda
paths:
- ".*\\.generated\\.go$"
- ".*bindata_assetfs\\.go$"
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
simplify: true
exclusions:
paths:
- ".*\\.generated\\.go$"
- ".*bindata_assetfs\\.go$"