From 662dbfdf147a52ed999f532fab0750384e2e5886 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 16 Jan 2025 16:42:39 +0100 Subject: [PATCH] Enable a few new linters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * exptostd ensures features in the standard library are used rather than their experimental predecessors * nilnesserr flags error checks that don’t return the checked error * usetesting flags function calls that should be replaced with variants in the testing package Signed-off-by: Stephen Kitt --- .golangci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 69d98c6b7..34f6a22eb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -70,6 +70,7 @@ linters: - errname # - execinquery # No SQL - exhaustive + - exptostd # - exhaustruct # This is too cumbersome as it requires all string, int, pointer et al fields to be initialized even when the # type's default suffices, which is most of the time - fatcontext @@ -120,6 +121,7 @@ linters: - nakedret # - nestif # This calculates cognitive complexity but we're doing that elsewhere - nilerr + - nilnesserr - nilnil # - nlreturn # This is reasonable with a block-size of 2 but setting it above isn't honored # - noctx # We don't send HTTP requests @@ -154,6 +156,7 @@ linters: - unparam - unused - usestdlibvars + - usetesting # - varnamelen # It doesn't seem necessary to enforce a minimum variable name length - wastedassign - whitespace