From 07060a7ce5c3d7732efb3e2d42fb763e7321bdb2 Mon Sep 17 00:00:00 2001 From: Oliver Hassett Date: Sun, 21 May 2023 21:54:44 +1000 Subject: [PATCH] Add .golangci.yml --- .golangci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ flag_test.go | 7 +++++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..82f7875 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,40 @@ +run: + timeout: 5m + +linters: + enable: + - errname + - exhaustive + - exportloopref + - gci + - goconst + - godot + - gofmt + - makezero + - unconvert + - unparam + - whitespace + +linters-settings: + exhaustive: + default-signifies-exhaustive: true + goconst: + min-len: 2 + min-occurrences: 2 + gofmt: + rewrite-rules: + - pattern: interface{} + replacement: any + govet: + enable-all: true + disable: + - fieldalignment + - shadow + makezero: + always: false + +issues: + exclude-rules: + - path: _test\.go$ + linters: + - goconst diff --git a/flag_test.go b/flag_test.go index 3e747bf..972fa97 100644 --- a/flag_test.go +++ b/flag_test.go @@ -1,7 +1,10 @@ package main -import "testing" -import "github.com/google/go-cmp/cmp" +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) func TestRecoveryLevel_Set(t *testing.T) { assertLevel := func(t *testing.T, want recoveryLevel, s string) {