From d1977251f924c9b034bdaba452890d38a87aeaf0 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sat, 18 Jan 2025 10:03:05 +0100 Subject: [PATCH] chore: explicit revive rules Signed-off-by: Matthieu MOREL --- .golangci.yml | 63 +++++++++++++++++++++++++++++++----------- docker/docker_linux.go | 2 +- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0bf3e187d..c3330cd8f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,21 +1,6 @@ issues: max-same-issues: 0 - exclude-rules: - - linters: - - gosec - text: G115 - - linters: - - revive - text: var-naming - - linters: - - revive - text: exported - - linters: - - revive - text: empty-block - - linters: - - revive - text: unused-parameter + exclude-rules: [] linters: enable: - asciicheck @@ -58,6 +43,9 @@ linters-settings: recommandations: - io - os + gosec: + excludes: + - G115 perfsprint: # Optimizes even if it requires an int or uint type cast. int-conversion: true @@ -69,5 +57,48 @@ linters-settings: sprintf1: true # Optimizes into strings concatenation. strconcat: true + revive: + rules: + - name: blank-imports + - name: context-as-argument + arguments: + - allowTypesBefore: "*testing.T" + - name: context-keys-type + - name: dot-imports + - name: duplicated-imports + - name: early-return + arguments: + - "preserveScope" + - name: empty-block + disabled: true + - name: error-naming + - name: error-return + - name: error-strings + - name: exported + disabled: true + - name: errorf + - name: increment-decrement + - name: indent-error-flow + arguments: + - "preserveScope" + - name: range + - name: receiver-naming + - name: redefines-builtin-id + - name: redundant-import-alias + - name: superfluous-else + arguments: + - "preserveScope" + - name: time-naming + - name: unexported-return + - name: unnecessary-stmt + disabled: true + - name: unreachable-code + - name: unused-parameter + disabled: true + - name: use-any + disabled: true + - name: var-declaration + - name: var-naming + disabled: true testifylint: enable-all: true diff --git a/docker/docker_linux.go b/docker/docker_linux.go index 23e7ef16f..5ac15814d 100644 --- a/docker/docker_linux.go +++ b/docker/docker_linux.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - cpu "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/shirou/gopsutil/v4/internal/common" )