44# This file is not a configuration example,
55# it contains the exhaustive configuration with explanations of the options.
66
7- issues :
8- # Which files to exclude: they will be analyzed, but issues from them won't be reported.
9- # There is no need to include all autogenerated files,
10- # we confidently recognize autogenerated files.
11- # If it's not, please let us know.
12- # "/" will be replaced by current OS file path separator to properly work on Windows.
13- # Default: []
14- exclude-files :
15- - " .*_ssz\\ .go$"
7+ version : " 2"
168
179# Options for analysis running.
1810run :
6961 # Define the Go version limit.
7062 # Mainly related to generics support since go1.18.
7163 # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
72- # go: '1.20 '
64+ # go: '1.19 '
7365
7466
7567# output configuration options
76- # output:
77- # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
78- #
79- # Multiple can be specified by separating them by comma, output can be provided
80- # for each of them by separating format name and path by colon symbol.
81- # Output path can be either `stdout`, `stderr` or path to the file to write to.
82- # Example: "checkstyle:report.json,colored-line-number"
83- #
84- # Default: colored-line-number
85- # format: json
86-
87- # Print lines of code with issue.
88- # Default: true
89- # print-issued-lines: false
90-
91- # Print linter name in the end of issue text.
92- # Default: true
93- # print-linter-name: false
94-
95- # Make issues output unique by line.
96- # Default: true
97- # uniq-by-line: false
98-
99- # Add a prefix to the output file references.
100- # Default is no prefix.
101- # path-prefix: ""
102-
103- # Sort results by: filepath, line and column.
104- # sort-results: true
105-
106-
107- # All available settings of specific linters.
108- linters-settings :
109- gosec :
110- excludes :
111- # Flags for potentially-unsafe casting of ints, but generates a lot of false positives.
112- - ' G115'
113-
114- lll :
115- line-length : 132
116-
117- nlreturn :
118- block-size : 3
119-
120- revive :
121- ignore-generated-header : false
122- severity : error
123- confidence : 0.8
124- enable-all-rules : true
125- rules :
126- - name : add-constant
127- disabled : true
128- - name : cyclomatic
129- disabled : true
130- - name : cognitive-complexity
131- disabled : true
132- - name : confusing-results
133- - name : function-length
134- disabled : true
135- - name : line-length-limit
136- arguments : [132]
137- - name : max-public-structs
138- disabled : true
139- - name : package-comments
140- disabled : true
141- - name : struct-tag
142- arguments : ["json,allowempty"]
143- - name : unhandled-error
144- arguments :
145- - " fmt.Fprint"
146- - " fmt.Fprintf"
147-
148- stylecheck :
149- checks : [ "all", "-ST1000" ]
150-
151- tagliatelle :
152- case :
153- # use-field-name: true
154- rules :
155- json : snake
156- yaml : snake
68+ output :
69+ formats :
70+ text :
71+ path : stderr
72+ colors : true
73+ print-issued-lines : true
15774
15875linters :
15976 # Enable all available linters.
16077 # Default: false
161- enable-all : true
78+ default : all
16279 # Disable specific linter
16380 # https://golangci-lint.run/usage/linters/#disabled-by-default
16481 disable :
@@ -169,18 +86,103 @@ linters:
16986 - exhaustive
17087 - exhaustruct
17188 - forcetypeassert
89+ - funcorder
17290 - funlen
173- - gci
17491 - gochecknoglobals
175- - gochecknoinits
17692 - gocognit
17793 - goconst
94+ - godoclint
95+ - iface
17896 - ireturn
17997 - lll
180- - maintidx
98+ - modernize
18199 - mnd
182- - musttag
100+ - nestif
101+ - nilnil
102+ - nlreturn
103+ - noinlineerr
183104 - perfsprint
105+ - promlinter
184106 - varnamelen
185107 - wrapcheck
186108 - wsl
109+ exclusions :
110+ paths :
111+ - " .*_ssz\\ .go$"
112+ settings :
113+ godot :
114+ scope : all
115+ period : true
116+ capital : false
117+
118+ gosec :
119+ excludes :
120+ - G115 # This generates a lot of false positives, recheck once https://github.com/securego/gosec/issues/1212 is closed
121+
122+ errcheck :
123+ exclude-functions :
124+ - fmt.Fprintf
125+
126+ lll :
127+ line-length : 132
128+
129+ nlreturn :
130+ # Allow two-line blocks without requiring a newline
131+ block-size : 3
132+
133+ tagliatelle :
134+ case :
135+ # use-field-name: true
136+ rules :
137+ json : snake
138+ yaml : snake
139+
140+ goheader :
141+ values :
142+ regexp :
143+ YEARS : ' (20\d\d - 20\d\d|20\d\d, 20\d\d|20\d\d)'
144+ template : |-
145+ Copyright © {{ YEARS }} Weald Technology Trading.
146+ Licensed under the Apache License, Version 2.0 (the "License");
147+ you may not use this file except in compliance with the License.
148+ You may obtain a copy of the License at
149+
150+ http://www.apache.org/licenses/LICENSE-2.0
151+
152+ Unless required by applicable law or agreed to in writing, software
153+ distributed under the License is distributed on an "AS IS" BASIS,
154+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
155+ See the License for the specific language governing permissions and
156+ limitations under the License.
157+
158+ revive :
159+ rules :
160+ - name : package-comments
161+ severity : warning
162+ disabled : true
163+ exclude : [ "" ]
164+
165+ wsl_v5 :
166+ disable :
167+ - assign
168+ - branch
169+ - decl
170+ - defer
171+ - expr
172+ - for
173+ - go
174+ - if
175+ - inc-dec
176+ - label
177+ - range
178+ - return
179+ - select
180+ - send
181+ - switch
182+ - type-switch
183+ - append
184+ - assign-exclusive
185+ - assign-expr
186+ - err
187+ - leading-whitespace
188+ - trailing-whitespace
0 commit comments