@@ -10,7 +10,7 @@ linters:
10
10
# Disable all linters.
11
11
# Default: false
12
12
disable-all : true
13
- # Enable specific linter
13
+ # Enable specific linter.
14
14
# https://golangci-lint.run/usage/linters/#enabled-by-default
15
15
enable :
16
16
- asasalint
@@ -276,6 +276,99 @@ linters:
276
276
fast : true
277
277
278
278
279
+ formatters :
280
+ # Enable specific formatter.
281
+ # Default: [] (uses standard Go formatting)
282
+ enable :
283
+ - gci
284
+ - gofmt
285
+ - gofumpt
286
+ - goimports
287
+ - golines
288
+
289
+ # Formatters settings.
290
+ settings :
291
+ gci :
292
+ # Section configuration to compare against.
293
+ # Section names are case-insensitive and may contain parameters in ().
294
+ # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
295
+ # If `custom-order` is `true`, it follows the order of `sections` option.
296
+ # Default: ["standard", "default"]
297
+ sections :
298
+ - standard # Standard section: captures all standard packages.
299
+ - default # Default section: contains all imports that could not be matched to another section type.
300
+ - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix.
301
+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
302
+ - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
303
+ - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
304
+ - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
305
+
306
+ # Checks that no inline comments are present.
307
+ # Default: false
308
+ no-inline-comments : true
309
+
310
+ # Checks that no prefix comments (comment lines above an import) are present.
311
+ # Default: false
312
+ no-prefix-comments : true
313
+
314
+ # Skip generated files.
315
+ # Default: true
316
+ skip-generated : false
317
+
318
+ # Enable custom order of sections.
319
+ # If `true`, make the section order the same as the order of `sections`.
320
+ # Default: false
321
+ custom-order : true
322
+
323
+ # Drops lexical ordering for custom sections.
324
+ # Default: false
325
+ no-lex-order : true
326
+
327
+ gofmt :
328
+ # Simplify code: gofmt with `-s` option.
329
+ # Default: true
330
+ simplify : false
331
+ # Apply the rewrite rules to the source before reformatting.
332
+ # https://pkg.go.dev/cmd/gofmt
333
+ # Default: []
334
+ rewrite-rules :
335
+ - pattern : ' interface{}'
336
+ replacement : ' any'
337
+ - pattern : ' a[b:len(a)]'
338
+ replacement : ' a[b:]'
339
+
340
+ gofumpt :
341
+ # Module path which contains the source code being formatted.
342
+ # Default: ""
343
+ module-path : github.com/org/project
344
+
345
+ # Choose whether to use the extra rules.
346
+ # Default: false
347
+ extra-rules : true
348
+
349
+ goimports :
350
+ # A comma-separated list of prefixes, which, if set, checks import paths
351
+ # with the given prefixes are grouped after 3rd-party packages.
352
+ # Default: ""
353
+ local-prefixes : github.com/org/project
354
+
355
+ golines :
356
+ # Target maximum line length.
357
+ # Default: 100
358
+ max-len : 200
359
+ # Length of a tabulation.
360
+ # Default: 4
361
+ tab-len : 8
362
+ # Shorten single-line comments.
363
+ # Default: false
364
+ shorten-comments : true
365
+ # Default: true
366
+ reformat-tags : false
367
+ # Split chained methods on the dots as opposed to the arguments.
368
+ # Default: true
369
+ chain-split-dots : false
370
+
371
+
279
372
# All available settings of specific linters.
280
373
linters-settings :
281
374
asasalint :
@@ -596,42 +689,6 @@ linters-settings:
596
689
# Default false
597
690
ignore-comments : true
598
691
599
- gci :
600
- # Section configuration to compare against.
601
- # Section names are case-insensitive and may contain parameters in ().
602
- # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
603
- # If `custom-order` is `true`, it follows the order of `sections` option.
604
- # Default: ["standard", "default"]
605
- sections :
606
- - standard # Standard section: captures all standard packages.
607
- - default # Default section: contains all imports that could not be matched to another section type.
608
- - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix.
609
- - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
610
- - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
611
- - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
612
- - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
613
-
614
- # Checks that no inline Comments are present.
615
- # Default: false
616
- no-inline-comments : true
617
-
618
- # Checks that no prefix Comments(comment lines above an import) are present.
619
- # Default: false
620
- no-prefix-comments : true
621
-
622
- # Skip generated files.
623
- # Default: true
624
- skip-generated : false
625
-
626
- # Enable custom order of sections.
627
- # If `true`, make the section order the same as the order of `sections`.
628
- # Default: false
629
- custom-order : true
630
-
631
- # Drops lexical ordering for custom sections.
632
- # Default: false
633
- no-lex-order : true
634
-
635
692
ginkgolinter :
636
693
# Suppress the wrong length assertion warning.
637
694
# Default: false
@@ -1313,28 +1370,6 @@ linters-settings:
1313
1370
- OPTIMIZE # marks code that should be optimized before merging
1314
1371
- HACK # marks hack-around that should be removed before merging
1315
1372
1316
- gofmt :
1317
- # Simplify code: gofmt with `-s` option.
1318
- # Default: true
1319
- simplify : false
1320
- # Apply the rewrite rules to the source before reformatting.
1321
- # https://pkg.go.dev/cmd/gofmt
1322
- # Default: []
1323
- rewrite-rules :
1324
- - pattern : ' interface{}'
1325
- replacement : ' any'
1326
- - pattern : ' a[b:len(a)]'
1327
- replacement : ' a[b:]'
1328
-
1329
- gofumpt :
1330
- # Module path which contains the source code being formatted.
1331
- # Default: ""
1332
- module-path : github.com/org/project
1333
-
1334
- # Choose whether to use the extra rules.
1335
- # Default: false
1336
- extra-rules : true
1337
-
1338
1373
goheader :
1339
1374
# Supports two types 'const` and `regexp`.
1340
1375
# Values can be used recursively.
@@ -1374,12 +1409,6 @@ linters-settings:
1374
1409
# Default: ""
1375
1410
template-path : /path/to/my/template.tmpl
1376
1411
1377
- goimports :
1378
- # A comma-separated list of prefixes, which, if set, checks import paths
1379
- # with the given prefixes are grouped after 3rd-party packages.
1380
- # Default: ""
1381
- local-prefixes : github.com/org/project
1382
-
1383
1412
gomoddirectives :
1384
1413
# Allow local `replace` directives.
1385
1414
# Default: false
0 commit comments