@@ -12,7 +12,33 @@ linters-settings:
1212 lines : 100
1313 statements : 50
1414 gci :
15- local-prefixes : github.com/obalunenko/advent-of-code
15+ # Section configuration to compare against.
16+ # Section names are case-insensitive and may contain parameters in ().
17+ # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
18+ # If `custom-order` is `true`, it follows the order of `sections` option.
19+ # Default: ["standard", "default"]
20+ sections :
21+ - standard # Standard section: captures all standard packages.
22+ - default # Default section: contains all imports that could not be matched to another section type.
23+ - prefix(github.com/obalunenko/advent-of-code) # Custom section: groups all imports with the specified Prefix.
24+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
25+ - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
26+ - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
27+ - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
28+
29+ # Skip generated files.
30+ # Default: true
31+ skip-generated : false
32+
33+ # Enable custom order of sections.
34+ # If `true`, make the section order the same as the order of `sections`.
35+ # Default: false
36+ custom-order : true
37+
38+ # Drops lexical ordering for custom sections.
39+ # Default: false
40+ no-lex-order : true
41+
1642 goconst :
1743 min-len : 2
1844 min-occurrences : 2
@@ -33,13 +59,128 @@ linters-settings:
3359 min-complexity : 15
3460 goimports :
3561 local-prefixes : github.com/obalunenko/advent-of-code
36- gomnd :
37- settings :
38- mnd :
39- # don't include the "operation" and "assign"
40- checks : [ argument,case,condition,return ]
62+ mnd :
63+ # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
64+ # Default: ["argument", "case", "condition", "operation", "return", "assign"]
65+ checks :
66+ - argument
67+ - case
68+ - condition
69+ - operation
70+ - return
71+ - assign
72+ # List of numbers to exclude from analysis.
73+ # The numbers should be written as string.
74+ # Values always ignored: "1", "1.0", "0" and "0.0"
75+ # Default: []
76+ ignored-numbers : []
77+ # List of file patterns to exclude from analysis.
78+ # Values always ignored: `.+_test.go`
79+ # Default: []
80+ ignored-files : []
81+ # List of function patterns to exclude from analysis.
82+ # Following functions are always ignored: `time.Date`,
83+ # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
84+ # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
85+ # Default: []
86+ ignored-functions : []
87+
4188 govet :
42- check-shadowing : true
89+ # Disable all analyzers.
90+ # Default: false
91+ disable-all : false
92+ # Enable analyzers by name.
93+ # (in addition to default:
94+ # appends, asmdecl, assign, atomic, bools, buildtag, cgocall, composites, copylocks, defers, directive, errorsas,
95+ # framepointer, httpresponse, ifaceassert, loopclosure, lostcancel, nilfunc, printf, shift, sigchanyzer, slog,
96+ # stdmethods, stringintconv, structtag, testinggoroutine, tests, timeformat, unmarshal, unreachable, unsafeptr,
97+ # unusedresult
98+ # ).
99+ # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers.
100+ # Default: []
101+ enable :
102+ # Check for missing values after append.
103+ - appends
104+ # Report mismatches between assembly files and Go declarations.
105+ - asmdecl
106+ # Check for useless assignments.
107+ - assign
108+ # Check for common mistakes using the sync/atomic package.
109+ - atomic
110+ # Check for non-64-bits-aligned arguments to sync/atomic functions.
111+ - atomicalign
112+ # Check for common mistakes involving boolean operators.
113+ - bools
114+ # Check //go:build and // +build directives.
115+ - buildtag
116+ # Detect some violations of the cgo pointer passing rules.
117+ - cgocall
118+ # Check for unkeyed composite literals.
119+ - composites
120+ # Check for locks erroneously passed by value.
121+ - copylocks
122+ # Check for calls of reflect.DeepEqual on error values.
123+ - deepequalerrors
124+ # Report common mistakes in defer statements.
125+ - defers
126+ # Check Go toolchain directives such as //go:debug.
127+ - directive
128+ # Report passing non-pointer or non-error values to errors.As.
129+ - errorsas
130+ # Find structs that would use less memory if their fields were sorted.
131+ - fieldalignment
132+ # Find calls to a particular function.
133+ - findcall
134+ # Report assembly that clobbers the frame pointer before saving it.
135+ - framepointer
136+ # Check for mistakes using HTTP responses.
137+ - httpresponse
138+ # Detect impossible interface-to-interface type assertions.
139+ - ifaceassert
140+ # Check references to loop variables from within nested functions.
141+ - loopclosure
142+ # Check cancel func returned by context.WithCancel is called.
143+ - lostcancel
144+ # Check for useless comparisons between functions and nil.
145+ - nilfunc
146+ # Check for redundant or impossible nil comparisons.
147+ - nilness
148+ # Check consistency of Printf format strings and arguments.
149+ - printf
150+ # Check for comparing reflect.Value values with == or reflect.DeepEqual.
151+ - reflectvaluecompare
152+ # Check for possible unintended shadowing of variables.
153+ - shadow
154+ # Check for shifts that equal or exceed the width of the integer.
155+ - shift
156+ # Check for unbuffered channel of os.Signal.
157+ - sigchanyzer
158+ # Check for invalid structured logging calls.
159+ - slog
160+ # Check the argument type of sort.Slice.
161+ - sortslice
162+ # Check signature of methods of well-known interfaces.
163+ - stdmethods
164+ # Check for string(int) conversions.
165+ - stringintconv
166+ # Check that struct field tags conform to reflect.StructTag.Get.
167+ - structtag
168+ # Report calls to (*testing.T).Fatal from goroutines started by a test.
169+ - testinggoroutine
170+ # Check for common mistaken usages of tests and examples.
171+ - tests
172+ # Check for calls of (time.Time).Format or time.Parse with 2006-02-01.
173+ - timeformat
174+ # Report passing non-pointer or non-interface values to unmarshal.
175+ - unmarshal
176+ # Check for unreachable code.
177+ - unreachable
178+ # Check for invalid conversions of uintptr to unsafe.Pointer.
179+ - unsafeptr
180+ # Check for unused results of calls to some functions.
181+ - unusedresult
182+ # Checks for unused writes.
183+ - unusedwrite
43184 lll :
44185 line-length : 140
45186 misspell :
@@ -58,7 +199,7 @@ linters:
58199 - dogsled
59200 - dupl
60201 - errcheck
61- - exportloopref
202+ - copyloopvar
62203 - exhaustive
63204 - funlen
64205 - gochecknoinits
@@ -67,7 +208,7 @@ linters:
67208 - gocyclo
68209 - gofmt
69210 - goimports
70- - gomnd
211+ - mnd
71212 - goprintffuncname
72213 - gosec
73214 - gosimple
@@ -104,6 +245,19 @@ linters:
104245 # - testpackage
105246
106247issues :
248+ # Show only new issues: if there are unstaged changes or untracked files,
249+ # only those changes are analyzed, else only changes in HEAD~ are analyzed.
250+ # It's a super-useful option for integration of golangci-lint into existing
251+ # large codebase. It's not practical to fix all existing issues at the moment
252+ # of integration: much better don't allow issues in new code.
253+ # Default is false.
254+ new : false
255+ # Fix found issues (if it's supported by the linter)
256+ fix : false
257+ exclude-files :
258+ - \.pb\.go$
259+ exclude-dirs :
260+ - vendor/
107261 exclude-use-default : false
108262 exclude :
109263 # for "public interface + private struct implementation" cases only!
@@ -137,55 +291,79 @@ issues:
137291 linters :
138292 - gochecknoinits
139293
140- # Show only new issues: if there are unstaged changes or untracked files,
141- # only those changes are analyzed, else only changes in HEAD~ are analyzed.
142- # It's a super-useful option for integration of golangci-lint into existing
143- # large codebase. It's not practical to fix all existing issues at the moment
144- # of integration: much better don't allow issues in new code.
145- # Default is false.
146- new : true
147-
148- # Fix found issues (if it's supported by the linter)
149- fix : false
150-
151- severity :
152- # Default value is empty string.
153- # Set the default severity for issues. If severity rules are defined and the issues
154- # do not match or no severity is provided to the rule this will be the default
155- # severity applied. Severities should match the supported severity names of the
156- # selected out format.
157- # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity
158- # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity
159- # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
160- default-severity : error
161-
162- # The default value is false.
163- # If set to true severity-rules regular expressions become case sensitive.
164- case-sensitive : false
165-
166- # Default value is empty list.
167- # When a list of severity rules are provided, severity information will be added to lint
168- # issues. Severity rules have the same filtering capability as exclude rules except you
169- # are allowed to specify one matcher per severity rule.
170- # Only affects out formats that support setting severity information.
171- rules :
172- - linters :
173- - dupl
174- severity : warning
175-
176294run :
177295 issues-exit-code : 0
178296 tests : true
179- skip-dirs :
180- - vendor/
181- skip-files :
182- - \.pb\.go$
297+
298+ severity :
299+ # Set the default severity for issues.
300+ #
301+ # If severity rules are defined and the issues do not match or no severity is provided to the rule
302+ # this will be the default severity applied.
303+ # Severities should match the supported severity names of the selected out format.
304+ # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity
305+ # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel
306+ # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
307+ # - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance
308+ #
309+ # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...)
310+ #
311+ # Default: ""
312+ default-severity : error
313+
314+ # If set to true `severity-rules` regular expressions become case-sensitive.
315+ # Default: false
316+ case-sensitive : true
317+
318+ # When a list of severity rules are provided, severity information will be added to lint issues.
319+ # Severity rules have the same filtering capability as exclude rules
320+ # except you are allowed to specify one matcher per severity rule.
321+ #
322+ # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...)
323+ #
324+ # Only affects out formats that support setting severity information.
325+ #
326+ # Default: []
327+ rules :
328+ - linters :
329+ - dupl
330+ severity : info
331+
183332
184333# output configuration options
185334output :
186335 # colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
187336 # default is "colored-line-number"
188- format : checkstyle
337+ formats :
338+ - format : colored-line-number
339+ path : stderr
340+ - format : checkstyle
341+ path : report.xml
342+ - format : colored-line-number
343+ path : linters.out
344+
345+
346+ # Order to use when sorting results.
347+ # Require `sort-results` to `true`.
348+ # Possible values: `file`, `linter`, and `severity`.
349+ #
350+ # If the severity values are inside the following list, they are ordered in this order:
351+ # 1. error
352+ # 2. warning
353+ # 3. high
354+ # 4. medium
355+ # 5. low
356+ # Either they are sorted alphabetically.
357+ #
358+ # Default: ["file"]
359+ sort-order :
360+ - linter
361+ - severity
362+ - file # filepath, line, and column.
363+
364+ # Show statistics per linter.
365+ # Default: false
366+ show-stats : true
189367
190368 # print lines of code with issue, default is true
191369 print-issued-lines : true
0 commit comments