From 41528739cef3d2b61e9b7437f6c557e60dbb79c0 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 13 Jun 2022 16:08:46 +0200 Subject: golangci-lint: enable nolintlint The nolintlint linter does not deny the use of `//nolint` Instead it allows us to enforce a common nolint style: - force that a linter name must be specified - do not add a space between `//` and `nolint` - make sure nolint is only used when there is actually a problem Signed-off-by: Paul Holzinger --- .golangci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.golangci.yml') diff --git a/.golangci.yml b/.golangci.yml index 15700cee7..31b0416fa 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,7 +13,6 @@ linters: enable-all: true disable: # All these break for one reason or another - - nolintlint # some linter must be disabled (see `nolint` in the code) - tagliatelle # too many JSON keys cannot be changed due to compat - gocognit - testpackage @@ -64,3 +63,6 @@ linters-settings: errcheck: check-blank: false ignore: fmt:.* + nolintlint: + allow-leading-space: false + require-specific: true -- cgit v1.2.3-54-g00ecf