2021-11-14 22:01:54 +02:00
|
|
|
linters-settings:
|
|
|
|
gofmt:
|
2021-11-14 23:33:45 +02:00
|
|
|
simplify: true
|
2023-11-29 21:21:18 +02:00
|
|
|
rewrite-rules:
|
|
|
|
- pattern: interface{}
|
|
|
|
replacement: any
|
2021-11-24 03:01:12 +02:00
|
|
|
misspell:
|
|
|
|
locale: US
|
2022-01-06 08:44:14 +02:00
|
|
|
gofumpt:
|
|
|
|
extra-rules: true
|
2023-03-21 01:48:15 +02:00
|
|
|
forbidigo:
|
|
|
|
forbid:
|
|
|
|
- context\.WithCancel$
|
|
|
|
- ^print.*$
|
|
|
|
- panic
|
2023-12-14 11:18:14 +02:00
|
|
|
- ^log.Fatal().*$
|
2023-03-21 01:48:15 +02:00
|
|
|
errorlint:
|
|
|
|
errorf-multi: true
|
2023-12-29 22:19:42 +02:00
|
|
|
depguard:
|
|
|
|
rules:
|
|
|
|
pipeline:
|
|
|
|
list-mode: lax
|
|
|
|
files:
|
|
|
|
- '**/pipeline/**/*.go'
|
|
|
|
- '**/pipeline/*.go'
|
|
|
|
- '!**/cli/pipeline/*.go'
|
|
|
|
- '!**/cli/pipeline/**/*.go'
|
|
|
|
- '!**/server/pipeline/*.go'
|
|
|
|
- '!**/server/pipeline/**/*.go'
|
|
|
|
deny:
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/web'
|
|
|
|
shared:
|
|
|
|
list-mode: lax
|
|
|
|
files:
|
|
|
|
- '**/shared/**/*.go'
|
|
|
|
- '**/shared/*.go'
|
|
|
|
- '!**/pipeline/shared/*.go'
|
|
|
|
- '!**/pipeline/shared/**/*.go'
|
|
|
|
deny:
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/pipeline'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/web'
|
|
|
|
woodpecker-go:
|
|
|
|
list-mode: lax
|
|
|
|
files:
|
|
|
|
- '**/woodpecker-go/woodpecker/**/*.go'
|
|
|
|
- '**/woodpecker-go/woodpecker/*.go'
|
|
|
|
deny:
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/pipeline'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/shared'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/web'
|
|
|
|
agent:
|
|
|
|
list-mode: lax
|
|
|
|
files:
|
|
|
|
- '**/agent/**/*.go'
|
|
|
|
- '**/agent/*.go'
|
|
|
|
- '**/cmd/agent/**/*.go'
|
|
|
|
- '**/cmd/agent/*.go'
|
|
|
|
deny:
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/web'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker'
|
|
|
|
cli:
|
|
|
|
list-mode: lax
|
|
|
|
files:
|
|
|
|
- '**/cli/**/*.go'
|
|
|
|
- '**/cli/*.go'
|
|
|
|
- '**/cmd/cli/**/*.go'
|
|
|
|
- '**/cmd/cli/*.go'
|
|
|
|
deny:
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/server'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/web'
|
|
|
|
server:
|
|
|
|
list-mode: lax
|
|
|
|
files:
|
|
|
|
- '**/server/**/*.go'
|
|
|
|
- '**/server/*.go'
|
|
|
|
- '**/cmd/server/**/*.go'
|
|
|
|
- '**/cmd/server/*.go'
|
|
|
|
- '**/web/**/*.go'
|
|
|
|
- '**/web/*.go'
|
|
|
|
deny:
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/agent'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/cli'
|
|
|
|
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker'
|
2024-01-09 22:35:37 +02:00
|
|
|
gci:
|
|
|
|
sections:
|
|
|
|
- standard
|
|
|
|
- default
|
|
|
|
- prefix(go.woodpecker-ci.org/woodpecker)
|
|
|
|
gomnd:
|
|
|
|
ignored-numbers:
|
|
|
|
- '0o600'
|
|
|
|
- '0o660'
|
|
|
|
- '0o644'
|
|
|
|
- '0o755'
|
|
|
|
- '0o700'
|
|
|
|
ignored-functions:
|
|
|
|
- make
|
|
|
|
- time.*
|
|
|
|
- strings.Split
|
|
|
|
- callerName
|
|
|
|
- securecookie.GenerateRandomKey
|
2021-11-14 22:01:54 +02:00
|
|
|
|
|
|
|
linters:
|
|
|
|
disable-all: true
|
|
|
|
enable:
|
2021-12-01 15:43:35 +02:00
|
|
|
- bidichk
|
|
|
|
- errcheck
|
2021-11-14 22:01:54 +02:00
|
|
|
- gofmt
|
|
|
|
- goimports
|
2021-11-23 16:36:52 +02:00
|
|
|
- gosimple
|
2021-12-01 15:43:35 +02:00
|
|
|
- govet
|
|
|
|
- ineffassign
|
2021-11-24 03:01:12 +02:00
|
|
|
- misspell
|
2021-12-01 15:43:35 +02:00
|
|
|
- revive
|
2021-11-25 18:15:36 +02:00
|
|
|
- staticcheck
|
2021-12-01 15:43:35 +02:00
|
|
|
- typecheck
|
2021-11-27 16:29:37 +02:00
|
|
|
- unused
|
2021-12-01 15:43:35 +02:00
|
|
|
- whitespace
|
2022-01-06 08:44:14 +02:00
|
|
|
- gofumpt
|
2023-02-02 01:08:02 +02:00
|
|
|
- errorlint
|
2023-03-21 01:48:15 +02:00
|
|
|
- forbidigo
|
2023-10-04 15:48:56 +02:00
|
|
|
- zerologlint
|
2023-12-29 22:19:42 +02:00
|
|
|
- depguard
|
2024-01-09 22:35:37 +02:00
|
|
|
- asciicheck
|
|
|
|
- bodyclose
|
|
|
|
- dogsled
|
|
|
|
- durationcheck
|
|
|
|
- errchkjson
|
|
|
|
- gochecknoinits
|
|
|
|
- goheader
|
|
|
|
- gomoddirectives
|
|
|
|
- gomodguard
|
|
|
|
- goprintffuncname
|
|
|
|
- importas
|
|
|
|
- makezero
|
|
|
|
- rowserrcheck
|
|
|
|
- sqlclosecheck
|
|
|
|
- tenv
|
|
|
|
- unconvert
|
|
|
|
- unparam
|
|
|
|
- wastedassign
|
|
|
|
- whitespace
|
2024-01-10 13:11:18 +02:00
|
|
|
- nolintlint
|
2021-11-26 01:27:43 +02:00
|
|
|
|
2021-11-16 22:07:53 +02:00
|
|
|
run:
|
2023-12-29 22:19:42 +02:00
|
|
|
timeout: 15m
|
2021-11-23 16:36:52 +02:00
|
|
|
|
|
|
|
issues:
|
|
|
|
exclude-rules:
|
2022-10-28 19:17:30 +02:00
|
|
|
# gin force us to use string as context key
|
|
|
|
- path: server/store/context.go
|
|
|
|
linters:
|
|
|
|
- staticcheck
|
|
|
|
- revive
|
2023-03-21 01:48:15 +02:00
|
|
|
|
2023-12-14 11:18:14 +02:00
|
|
|
# let cli use print and panic and log.Fatal()
|
2023-10-24 14:42:05 +02:00
|
|
|
- path: 'cmd/*|cli/*'
|
2023-03-21 01:48:15 +02:00
|
|
|
linters:
|
|
|
|
- forbidigo
|
2024-01-09 22:35:37 +02:00
|
|
|
|
2023-12-14 11:18:14 +02:00
|
|
|
# allow some setup functions to use log.Fatal()
|
2024-01-01 00:29:56 +02:00
|
|
|
- path: 'server/web/web.go|server/plugins/encryption/tink_keyset_watcher.go|shared/logger/logger.go'
|
2023-12-14 11:18:14 +02:00
|
|
|
linters:
|
|
|
|
- forbidigo
|
2024-01-09 22:35:37 +02:00
|
|
|
|
|
|
|
- path: '_test.go'
|
|
|
|
linters:
|
|
|
|
- forcetypeassert
|