audit-go/.golangci.yml
Christian Schaible (EXT) 6b5bc6dfe2 Merged PR 757276: feat: Validate topic names and update dependencies
Validates solace topic names to prevent issues when processing messages in the auditlog-appender.
Updates dependencies and build tools.

Security-concept-update-needed: false.

JIRA Work Item: STACKITALO-220
2025-03-31 12:32:16 +00:00

285 lines
5.7 KiB
YAML

version: "2"
run:
issues-exit-code: 1
tests: true
linters:
default: none
enable:
- asciicheck
- bodyclose
- copyloopvar
- cyclop
- dogsled
- dupl
- durationcheck
- errcheck
- errorlint
- exhaustive
- forbidigo
- forcetypeassert
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- govet
- importas
- ineffassign
- lll
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- nolintlint
- prealloc
- predeclared
- promlinter
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- tparallel
- unconvert
- unparam
- unused
- wastedassign
settings:
cyclop:
max-complexity: 45
package-average: 0
dogsled:
max-blank-identifiers: 2
dupl:
threshold: 150
errcheck:
check-type-assertions: true
check-blank: true
exhaustive:
default-signifies-exhaustive: true
funlen:
lines: 100
statements: 50
gocognit:
min-complexity: 45
goconst:
min-len: 3
min-occurrences: 5
gocritic:
disabled-checks:
- dupImport
- octalLiteral
- unnamedResult
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
settings:
hugeParam:
sizeThreshold: 121
gocyclo:
min-complexity: 45
govet:
disable:
- fieldalignment
enable-all: true
lll:
line-length: 180
tab-width: 1
nakedret:
max-func-lines: 5
nestif:
min-complexity: 10
nlreturn:
block-size: 5
nolintlint:
require-explanation: true
require-specific: true
allow-unused: false
prealloc:
simple: true
range-loops: true
for-loops: true
revive:
rules:
- name: context-keys-type
disabled: false
- name: time-naming
disabled: false
- name: var-declaration
disabled: false
- name: unexported-return
disabled: false
- name: errorf
disabled: false
- name: blank-imports
disabled: false
- name: context-as-argument
disabled: false
- name: dot-imports
disabled: false
- name: error-return
disabled: false
- name: error-strings
disabled: false
- name: error-naming
disabled: false
- name: exported
disabled: false
- name: increment-decrement
disabled: false
- name: var-naming
disabled: true
- name: package-comments
disabled: false
- name: range
disabled: false
- name: receiver-naming
disabled: false
- name: indent-error-flow
disabled: false
staticcheck:
initialisms:
- ACL
- API
- ASCII
- CPU
- CSS
- DNS
- EOF
- GUID
- HTML
- HTTP
- HTTPS
- ID
- IP
- JSON
- QPS
- RAM
- RPC
- SLA
- SMTP
- SQL
- SSH
- TCP
- TLS
- TTL
- UDP
- UI
- GID
- UID
- UUID
- URI
- URL
- UTF8
- VM
- XML
- XMPP
- XSRF
- XSS
- SIP
- RTP
- AMQP
- DB
- TS
unparam:
check-exported: false
unused:
exported-fields-are-used: false
whitespace:
multi-if: false
multi-func: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: audit/api/api_common.go
text: context-as-argument
- linters:
- gochecknoglobals
path: audit/api/api.go|log/log.go|audit/api/model.go|telemetry/telemetry.go
- linters:
- dupl
path: audit/api/api_.*.go
- path: audit/api/model.go
text: 'exported: type name will be used as api.ApiRequest by other packages'
- path: audit/api/model_test.go|audit/api/model.go
text: G115
- linters:
- gosec
path: audit/api/test_data.go
- linters:
- dogsled
- dupl
- errcheck
- forbidigo
- forcetypeassert
- gochecknoglobals
- gocognit
- goconst
- gocritic
- ineffassign
- lll
- nakedret
- nestif
- nlreturn
- noctx
- revive
- staticcheck
- unconvert
- unparam
- wastedassign
- wsl
path: _test\.go
- linters:
- govet
text: declaration of "err" shadows declaration
- linters:
- dogsled
- dupl
- errcheck
- forbidigo
- forcetypeassert
- gochecknoglobals
- gocognit
- goconst
- gocritic
- ineffassign
- lll
- nakedret
- nestif
- nlreturn
- noctx
- revive
- staticcheck
- unconvert
- unparam
- wastedassign
- wsl
path: test_.*\.go|audit/messaging/solace.go
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$