1717# This file contains all available configuration options
1818# with their default values.
1919
20+ version : 2
2021# options for analysis running
2122run :
2223 # default concurrency is a available CPU number
3637
3738# output configuration options
3839output :
39- # sort linter result
40- sort-results : true
4140 # sort order
4241 sort-order :
4342 - linter
@@ -46,111 +45,22 @@ output:
4645
4746 # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
4847 formats :
49- - format : json
48+ json :
5049 path : stderr
5150
52- # print lines of code with issue, default is true
53- print-issued-lines : true
54-
55- # print linter name in the end of issue text, default is true
56- print-linter-name : true
57-
5851issues :
5952 max-same-issues : 0
6053 max-issues-per-linter : 0
61- exclude-files :
62- - _test\.go
63- - cmd/example
64- - webdemo/
65-
66- # all available settings of specific linters
67- linters-settings :
68- revive :
69- rules :
70- - name : unused-parameter # disable unused-parameter rule
71- disabled : true
72- errcheck :
73- # report about not checking of errors in type assetions: `a := b.(MyStruct)`;
74- # default is false: such cases aren't reported by default.
75- check-type-assertions : false
76-
77- # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
78- # default is false: such cases aren't reported by default.
79- check-blank : false
80- govet :
81- # report about shadowed variables
82- enable :
83- - shadow
84- gofmt :
85- # simplify code: gofmt with `-s` option, true by default
86- simplify : true
87- goimports :
88- # put imports beginning with prefix after 3rd-party packages;
89- # it's a comma-separated list of prefixes
90- local-prefixes : github.com/secretflow/kuscia
91- gocyclo :
92- # minimal code complexity to report, 30 by default (but we recommend 10-20)
93- min-complexity : 10
94- dupl :
95- # tokens count to trigger issue, 150 by default
96- threshold : 150
97- goconst :
98- # minimal length of string constant, 3 by default
99- min-len : 3
100- # minimal occurrences count to trigger, 3 by default
101- min-occurrences : 3
102- depguard :
103- rules :
104- main :
105- deny :
106- - pkg : " github.com/davecgh/go-spew/spew"
107- misspell :
108- # Correct spellings using locale preferences for US or UK.
109- # Default is to use a neutral variety of English.
110- # Setting locale to US will correct the British spelling of 'colour' to 'color'.
111- locale : US
112- ignore-words :
113- - someword
114- lll :
115- # max line length, lines longer will be reported. Default is 120.
116- # '\t' is counted as 1 character by default, and can be changed with the tab-width option
117- line-length : 120
118- # tab width in spaces. Default to 1.
119- tab-width : 1
120- unused :
121- parameters-are-used : true
122- exported-fields-are-used : true
123- unparam :
124- # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
125- # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
126- # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
127- # with golangci-lint call it on a directory with the changed file.
128- check-exported : false
129- nakedret :
130- # make an issue if func has more lines of code than this setting and it has naked returns; default is 30
131- max-func-lines : 30
132- prealloc :
133- # XXX: we don't recommend using this linter before doing performance profiling.
134- # For most programs usage of prealloc will be a premature optimization.
135-
136- # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
137- # True by default.
138- simple : true
139- range-loops : true # Report preallocation suggestions on range loops, true by default
140- for-loops : false # Report preallocation suggestions on for loops, false by default
141- gocritic :
142- # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
143- disabled-checks :
144- - regexpMust
145-
146- # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
147- # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
148- enabled-tags :
149- - performance
150-
151- settings : # settings passed to gocritic
152- captLocal : # must be valid enabled check name
153- paramsOnly : true
54+
55+ formatters :
56+ settings :
57+ gofmt :
58+ # simplify code: gofmt with `-s` option, true by default
59+ simplify : true
60+ goimports :
61+ # put imports beginning with prefix after 3rd-party packages;
62+ # it's a comma-separated list of prefixes
63+ local-prefixes : github.com/secretflow/kuscia
15464
15565linters :
15666 enable :
@@ -160,6 +70,101 @@ linters:
16070 - errcheck
16171 - goconst
16272 - dupl
163- - goimports
164- disable-all : true
165- fast : false
73+ disable :
74+ - ineffassign
75+ - staticcheck
76+ exclusions :
77+ rules :
78+ - source : Close
79+ linters :
80+ - errcheck
81+ paths :
82+ - _test\.go
83+ - cmd/example
84+ - webdemo/.*
85+ - pkg/datamesh/dataserver/io/builtin/.*
86+ # all available settings of specific linters
87+ settings :
88+ revive :
89+ rules :
90+ - name : unused-parameter # disable unused-parameter rule
91+ disabled : true
92+ errcheck :
93+ # report about not checking of errors in type assetions: `a := b.(MyStruct)`;
94+ # default is false: such cases aren't reported by default.
95+ check-type-assertions : false
96+
97+ # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
98+ # default is false: such cases aren't reported by default.
99+ check-blank : false
100+ exclude-functions :
101+ - os.Remove
102+ - os.RemoveAll
103+ govet :
104+ # report about shadowed variables
105+ enable :
106+ - shadow
107+ gocyclo :
108+ # minimal code complexity to report, 30 by default (but we recommend 10-20)
109+ min-complexity : 10
110+ dupl :
111+ # tokens count to trigger issue, 150 by default
112+ threshold : 150
113+ goconst :
114+ # minimal length of string constant, 3 by default
115+ min-len : 3
116+ # minimal occurrences count to trigger, 3 by default
117+ min-occurrences : 3
118+ depguard :
119+ rules :
120+ main :
121+ deny :
122+ - pkg : " github.com/davecgh/go-spew/spew"
123+ misspell :
124+ # Correct spellings using locale preferences for US or UK.
125+ # Default is to use a neutral variety of English.
126+ # Setting locale to US will correct the British spelling of 'colour' to 'color'.
127+ locale : US
128+ ignore-rules :
129+ - someword
130+ lll :
131+ # max line length, lines longer will be reported. Default is 120.
132+ # '\t' is counted as 1 character by default, and can be changed with the tab-width option
133+ line-length : 120
134+ # tab width in spaces. Default to 1.
135+ tab-width : 1
136+ unused :
137+ parameters-are-used : true
138+ exported-fields-are-used : true
139+ unparam :
140+ # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
141+ # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
142+ # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
143+ # with golangci-lint call it on a directory with the changed file.
144+ check-exported : false
145+ nakedret :
146+ # make an issue if func has more lines of code than this setting and it has naked returns; default is 30
147+ max-func-lines : 30
148+ prealloc :
149+ # XXX: we don't recommend using this linter before doing performance profiling.
150+ # For most programs usage of prealloc will be a premature optimization.
151+
152+ # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
153+ # True by default.
154+ simple : true
155+ range-loops : true # Report preallocation suggestions on range loops, true by default
156+ for-loops : false # Report preallocation suggestions on for loops, false by default
157+ gocritic :
158+ # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
159+ disabled-checks :
160+ - regexpMust
161+
162+ # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
163+ # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
164+ enabled-tags :
165+ - performance
166+
167+ settings : # settings passed to gocritic
168+ captLocal : # must be valid enabled check name
169+ paramsOnly : true
170+
0 commit comments