1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-27 01:33:39 +02:00
goreleaser/.golangci.yaml
Oleksandr Redko 12155a336b
refactor: remove empty lines, fix //nolint (#5235)
The PR formats code by removing redundant empty lines and fixes
`//nolint` directives. Additionally, this PR adds two more rules to the
`revive` configuration: `empty-lines` and `comment-spacings`.

Removing unnecessary empty lines helps to keep the codebase clean and
concise. This issue is identified by the `revive.empty-lines` rule.

In the `//nolint` directive, there must be no spaces between `:` and the
linter name: `//nolint:gosec`. See ["Nolint
Directive"](https://golangci-lint.run/usage/false-positives/#nolint-directive).
This issue is identified by the `revive.comment-spacings` rule.

Note that it's not possible to add just a few additional rules to the
`revive.enable` list. We need to specify all: default rules plus
additional rules. See the detailed explanation
[here](https://github.com/prometheus/prometheus/pull/13068).
2024-10-31 13:51:54 -03:00

77 lines
1.5 KiB
YAML

run:
go: "1.23"
timeout: 5m
linters:
enable:
- copyloopvar
- thelper
- gofumpt
- bodyclose
- tparallel
- unconvert
- unparam
- wastedassign
- revive
- forbidigo
- tagliatelle
- misspell
- depguard
- testifylint
- gocritic
- nolintlint
linters-settings:
gocritic:
disabled-checks:
- appendAssign
staticcheck:
checks:
- all
- "-SA1019"
forbidigo:
forbid:
- 'ioutil\.*'
tagliatelle:
case:
use-field-name: false
rules:
yaml: snake
json: snake
depguard:
rules:
main:
deny:
- pkg: "github.com/pkg/errors"
desc: "use stdlib instead"
revive:
enable-all-rules: false
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: comment-spacings
- name: dot-imports
- name: empty-block
- name: empty-lines
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming
testifylint:
enable-all: true
disable:
- error-is-as # false positive