mirror of
https://github.com/xataio/pgroll.git
synced 2024-10-26 13:52:56 +03:00
882efcab73
Update to the latest version of `golangci-lint`. Also add an explicit `setup-go` step to the workflow before the `golangci-lint` step. Without this, `golangci-lint` seems to pick up the wrong Go version installed on the runners (see the list [here](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#go)), causing it to fail when running against #139
81 lines
1.4 KiB
YAML
81 lines
1.4 KiB
YAML
goVersion: &goVersion "1.21"
|
|
|
|
run:
|
|
go: *goVersion
|
|
timeout: 5m
|
|
|
|
linters:
|
|
disable-all: true
|
|
# Enable specific linter
|
|
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
|
|
enable:
|
|
- errorlint
|
|
- exportloopref
|
|
- forcetypeassert
|
|
- goconst
|
|
- gocritic
|
|
- gofumpt
|
|
- gosec
|
|
- gosimple
|
|
- govet
|
|
- ineffassign
|
|
- makezero
|
|
- misspell
|
|
- nakedret
|
|
- nolintlint
|
|
- prealloc
|
|
- prealloc
|
|
- staticcheck
|
|
- stylecheck
|
|
- unused
|
|
|
|
linters-settings:
|
|
errorlint:
|
|
errorf: true
|
|
|
|
gomodguard:
|
|
blocked:
|
|
# List of blocked modules.
|
|
modules:
|
|
# Blocked module.
|
|
- github.com/pkg/errors:
|
|
# Recommended modules that should be used instead. (Optional)
|
|
recommendations:
|
|
- errors
|
|
- fmt
|
|
reason: "This package is deprecated, use `fmt.Errorf` with `%w` instead"
|
|
|
|
goconst:
|
|
ignore-tests: true
|
|
numbers: true
|
|
|
|
gocritic:
|
|
disabled-checks:
|
|
- exitAfterDefer
|
|
- ifElseChain
|
|
- commentFormatting
|
|
|
|
gofumpt:
|
|
lang-version: *goVersion
|
|
module-path: "pgroll"
|
|
extra-rules: false
|
|
|
|
staticcheck:
|
|
go: *goVersion
|
|
checks: ["all"]
|
|
|
|
stylecheck:
|
|
go: *goVersion
|
|
checks: ["all", "-ST1000", "-ST1005"]
|
|
|
|
unused:
|
|
go: *goVersion
|
|
|
|
makezero:
|
|
always: false
|
|
|
|
gosec:
|
|
exclude-generated: true
|
|
severity: low
|
|
includes: []
|