11---
2+ version : 2
23run :
34 tests : false
5+ formatters :
6+ settings :
7+ gofmt :
8+ # Apply the rewrite rules to the source before reformatting.
9+ # https://pkg.go.dev/cmd/gofmt
10+ # Default: []
11+ rewrite-rules :
12+ - pattern : " interface{}"
13+ replacement : " any"
14+ - pattern : " a[b:len(a)]"
15+ replacement : " a[b:]"
16+ goimports :
17+ # Put imports beginning with prefix after 3rd-party packages.
18+ local-prefixes :
19+ - github.com/martinbaillie
420
521linters :
622 disable-all : true
@@ -24,12 +40,9 @@ linters:
2440 - gocritic # provides diagnostics that check for bugs, performance and style issues
2541 - gocyclo # computes and checks the cyclomatic complexity of functions
2642 - godot # checks if comments end in a period
27- - gofmt # the classic
28- - goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
2943 # - gomnd # detects magic numbers
3044 - goprintffuncname # checks that printf-like functions are named with f at the end
3145 - gosec # inspects source code for security problems
32- - gosimple # specializes in simplifying a code
3346 - govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
3447 - ineffassign # detects when assignments to existing variables are not used
3548 # - ireturn # accept interfaces, return concrete types
@@ -47,13 +60,10 @@ linters:
4760 - reassign # checks that package variables are not reassigned
4861 - revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
4962 - staticcheck # is a go vet on steroids, applying a ton of static analysis checks
50- - stylecheck # is a replacement for golint
5163 # - tagliatelle # struct tag issues
52- - tenv # detects using os.Setenv instead of t.Setenv since Go1.17
5364 - testpackage # makes you use a separate _test package
5465 - thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
5566 - tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
56- - typecheck # like the front-end of a Go compiler, parses and type-checks Go code
5767 - unconvert # removes unnecessary type conversions
5868 - unparam # reports unused function parameters
5969 - unused # checks for unused constants, variables, functions and types
@@ -97,10 +107,6 @@ linters-settings:
97107 allow-cuddle-declarations : true
98108 allow-assign-and-anything : true
99109
100- goimports :
101- # Put imports beginning with prefix after 3rd-party packages.
102- local-prefixes : github.com/martinbaillie
103-
104110 gocritic :
105111 # The settings key is the name of a supported gocritic checker. The list of
106112 # supported checkers can be find in https://go-critic.github.io/overview.
@@ -113,16 +119,6 @@ linters-settings:
113119 # Default: true
114120 skipRecvDeref : false
115121
116- gofmt :
117- # Apply the rewrite rules to the source before reformatting.
118- # https://pkg.go.dev/cmd/gofmt
119- # Default: []
120- rewrite-rules :
121- - pattern : " interface{}"
122- replacement : " any"
123- - pattern : " a[b:len(a)]"
124- replacement : " a[b:]"
125-
126122 gomnd :
127123 # Magic numbers. List of function patterns to exclude from analysis. Values
128124 # always ignored: `time.Date` Default: []
@@ -161,7 +157,7 @@ linters-settings:
161157
162158 nolintlint :
163159 # Exclude following linters from requiring an explanation. Default: []
164- allow-no-explanation : [funlen, gocognit, lll]
160+ allow-no-explanation : [ funlen, gocognit, lll ]
165161 # Enable to require an explanation of nonzero length after each nolint
166162 # directive. Default: false
167163 require-explanation : true
0 commit comments