@@ -122,6 +122,7 @@ linters-settings:
122
122
123
123
cyclop :
124
124
# The maximal code complexity to report.
125
+ # Default: 10
125
126
max-complexity : 10
126
127
# The maximal average package complexity.
127
128
# If it's higher than 0.0 (float) the check is enabled
@@ -284,26 +285,30 @@ linters-settings:
284
285
# The struct packages have the form `example.com/package.ExampleStruct`.
285
286
# The matching patterns can use matching syntax from https://pkg.go.dev/path#Match.
286
287
# If this list is empty, all structs are tested.
288
+ # Default: []
287
289
struct-patterns :
288
290
- ' *.Test'
289
291
- ' example.com/package.ExampleStruct'
290
292
291
293
exhaustruct :
292
294
# List of regular expressions to match struct packages and names.
293
295
# If this list is empty, all structs are tested.
296
+ # Default: []
294
297
include :
295
298
- ' .*\.Test'
296
299
- ' example\.com/package\.ExampleStruct[\d]{1,2}'
297
300
# List of regular expressions to exclude struct packages and names from check.
301
+ # Default: []
298
302
exclude :
299
303
- ' cobra\.Command$'
300
304
301
305
forbidigo :
302
306
# Forbid the following identifiers (list of regexp).
307
+ # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
303
308
forbid :
304
309
- ^print.*$
305
310
- ' fmt\.Print.*'
306
- # Optionally put comments at the end of the regex, surrounded by `(# )?`
311
+ # Optionally put comments at the end of the regex, surrounded by `(# )?`
307
312
# Escape any special characters.
308
313
- ' fmt\.Print.*(# Do not commit print statements\.)?'
309
314
# Exclude godoc examples from forbidigo checks.
@@ -487,6 +492,7 @@ linters-settings:
487
492
skipRecvDeref : false
488
493
unnamedResult :
489
494
# Whether to check exported functions.
495
+ # Default: false
490
496
checkExported : true
491
497
492
498
gocyclo :
@@ -499,6 +505,7 @@ linters-settings:
499
505
# Default: declarations
500
506
scope : toplevel
501
507
# List of regexps for excluding particular comment lines from check.
508
+ # Default: []
502
509
exclude :
503
510
# Exclude todo and fixme comments.
504
511
- " ^fixme:"
@@ -513,7 +520,7 @@ linters-settings:
513
520
godox :
514
521
# Report any comments starting with keywords, this is useful for TODO or FIXME comments that
515
522
# might be left in the code accidentally and should be resolved before merging.
516
- # Default: TODO, BUG, and FIXME.
523
+ # Default: [" TODO", " BUG", " FIXME"]
517
524
keywords :
518
525
- NOTE
519
526
- OPTIMIZE # marks code that should be optimized before merging
@@ -526,11 +533,11 @@ linters-settings:
526
533
527
534
gofumpt :
528
535
# Select the Go version to target.
529
- # Default: 1.15
536
+ # Default: " 1.15"
530
537
lang-version : " 1.17"
531
538
532
539
# Module path which contains the source code being formatted.
533
- # Default: empty string
540
+ # Default: ""
534
541
module-path : github.com/org/project
535
542
536
543
# Choose whether to use the extra rules.
@@ -540,6 +547,7 @@ linters-settings:
540
547
goheader :
541
548
# Supports two types 'const` and `regexp`.
542
549
# Values can be used recursively.
550
+ # Default: {}
543
551
values :
544
552
const :
545
553
# Define here const type values in format k:v.
@@ -550,6 +558,7 @@ linters-settings:
550
558
# for example:
551
559
AUTHOR : .*@mycompany\.com
552
560
# The template use for checking.
561
+ # Default: ""
553
562
template : |-
554
563
# Put here copyright header template for source code files
555
564
# For example:
@@ -571,11 +580,13 @@ linters-settings:
571
580
# limitations under the License.
572
581
# As alternative of directive 'template', you may put the path to file with the template source.
573
582
# Useful if you need to load the template from a specific file.
583
+ # Default: ""
574
584
template-path : /path/to/my/template.tmpl
575
585
576
586
goimports :
577
587
# Put imports beginning with prefix after 3rd-party packages.
578
588
# It's a comma-separated list of prefixes.
589
+ # Default: ""
579
590
local-prefixes : github.com/org/project
580
591
581
592
golint :
@@ -585,6 +596,7 @@ linters-settings:
585
596
586
597
gomnd :
587
598
# List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
599
+ # Default: ["argument", "case", "condition", "operation", "return", "assign"]
588
600
checks :
589
601
- argument
590
602
- case
@@ -595,22 +607,26 @@ linters-settings:
595
607
# List of numbers to exclude from analysis.
596
608
# The numbers should be written as string.
597
609
# Values always ignored: "1", "1.0", "0" and "0.0"
610
+ # Default: []
598
611
ignored-numbers :
599
612
- ' 0666'
600
613
- ' 0755'
601
614
- ' 42'
602
615
# List of file patterns to exclude from analysis.
603
616
# Values always ignored: `.+_test.go`
617
+ # Default: []
604
618
ignored-files :
605
619
- ' magic1_.*.go'
606
620
# List of function patterns to exclude from analysis.
607
621
# Values always ignored: `time.Time`
622
+ # Default: []
608
623
ignored-functions :
609
624
- ' math.*'
610
625
- ' http.StatusText'
611
626
612
627
gomoddirectives :
613
628
# Allow local `replace` directives.
629
+ # Default: false
614
630
replace-local : false
615
631
# List of allowed `replace` directives.
616
632
# Default: []
@@ -626,13 +642,16 @@ linters-settings:
626
642
gomodguard :
627
643
allowed :
628
644
# List of allowed modules.
645
+ # Default: []
629
646
modules :
630
647
- gopkg.in/yaml.v2
631
648
# List of allowed module domains.
649
+ # Default: []
632
650
domains :
633
651
- golang.org
634
652
blocked :
635
653
# List of blocked modules.
654
+ # Default: []
636
655
modules :
637
656
# Blocked module.
638
657
- github.com/uudashr/go-module :
@@ -642,6 +661,7 @@ linters-settings:
642
661
# Reason why the recommended module should be used. (Optional)
643
662
reason : " `mod` is the official go.mod parser library."
644
663
# List of blocked module version constraints.
664
+ # Default: []
645
665
versions :
646
666
# Blocked module with version constraint.
647
667
- github.com/mitchellh/go-homedir :
@@ -650,13 +670,15 @@ linters-settings:
650
670
# Reason why the version constraint exists. (Optional)
651
671
reason : " testing if blocked version constraint works."
652
672
# Set to true to raise lint issues for packages that are loaded from a local path via replace directive.
673
+ # Default: false
653
674
local_replace_directives : false
654
675
655
676
gosimple :
656
677
# Select the Go version to target.
657
678
# Default: 1.13
658
679
go : " 1.15"
659
680
# https://staticcheck.io/docs/options#checks
681
+ # Default: ["*"]
660
682
checks : [ "all" ]
661
683
662
684
gosec :
@@ -909,6 +931,7 @@ linters-settings:
909
931
# Default: false
910
932
no-extra-aliases : true
911
933
# List of aliases
934
+ # Default: []
912
935
alias :
913
936
# Using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package.
914
937
- pkg : knative.dev/serving/pkg/apis/serving/v1
@@ -975,6 +998,7 @@ linters-settings:
975
998
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
976
999
# Default is to use a neutral variety of English.
977
1000
locale : US
1001
+ # Default: []
978
1002
ignore-words :
979
1003
- someword
980
1004
@@ -990,7 +1014,7 @@ linters-settings:
990
1014
991
1015
nilnil :
992
1016
# Checks that there is no simultaneous return of `nil` error and an invalid value.
993
- # Default: ptr, func, iface, map, chan
1017
+ # Default: [" ptr", " func", " iface", " map", " chan"]
994
1018
checked-types :
995
1019
- ptr
996
1020
- func
@@ -1049,6 +1073,7 @@ linters-settings:
1049
1073
# Default: false
1050
1074
strict : true
1051
1075
# Please refer to https://github.com/yeya24/promlinter#usage for detailed usage.
1076
+ # Default: []
1052
1077
disabled-linters :
1053
1078
- Help
1054
1079
- MetricUnits
@@ -1398,28 +1423,35 @@ linters-settings:
1398
1423
disabled : false
1399
1424
1400
1425
rowserrcheck :
1426
+ # database/sql is always checked
1427
+ # Default: []
1401
1428
packages :
1402
1429
- github.com/jmoiron/sqlx
1403
1430
1404
1431
staticcheck :
1405
1432
# Select the Go version to target.
1406
- # Default: 1.13
1433
+ # Default: " 1.13"
1407
1434
go : " 1.15"
1408
1435
# https://staticcheck.io/docs/options#checks
1436
+ # Default: ["*"]
1409
1437
checks : [ "all" ]
1410
1438
1411
1439
stylecheck :
1412
1440
# Select the Go version to target.
1413
1441
# Default: 1.13
1414
1442
go : " 1.15"
1415
1443
# https://staticcheck.io/docs/options#checks
1444
+ # Default: ["*"]
1416
1445
checks : [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
1417
1446
# https://staticcheck.io/docs/options#dot_import_whitelist
1447
+ # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"]
1418
1448
dot-import-whitelist :
1419
1449
- fmt
1420
1450
# https://staticcheck.io/docs/options#initialisms
1421
- initialisms : [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS" ]
1451
+ # Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
1452
+ initialisms : [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ]
1422
1453
# https://staticcheck.io/docs/options#http_status_code_whitelist
1454
+ # Default: ["200", "400", "404", "500"]
1423
1455
http-status-code-whitelist : [ "200", "400", "404", "500" ]
1424
1456
1425
1457
tagliatelle :
@@ -1428,6 +1460,8 @@ linters-settings:
1428
1460
# Use the struct field name to check the name of the struct tag.
1429
1461
# Default: false
1430
1462
use-field-name : true
1463
+ # `camel` is used for `json` and `yaml` (can be overridden)
1464
+ # Default: {}
1431
1465
rules :
1432
1466
# Any struct tag type can be used.
1433
1467
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
@@ -1440,11 +1474,13 @@ linters-settings:
1440
1474
1441
1475
tenv :
1442
1476
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
1443
- # By default, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
1477
+ # Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
1478
+ # Default: false
1444
1479
all : false
1445
1480
1446
1481
testpackage :
1447
- # regexp pattern to skip files
1482
+ # Regexp pattern to skip files.
1483
+ # Default: "(export|internal)_test\\.go"
1448
1484
skip-regexp : (export|internal)_test\.go
1449
1485
1450
1486
thelper :
@@ -1539,6 +1575,7 @@ linters-settings:
1539
1575
# An array of strings that specify substrings of signatures to ignore.
1540
1576
# If this set, it will override the default set of ignored signatures.
1541
1577
# See https://github.com/tomarrell/wrapcheck#configuration for more information.
1578
+ # Default: [".Errorf(", "errors.New(", "errors.Unwrap(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("]
1542
1579
ignoreSigs :
1543
1580
- .Errorf(
1544
1581
- errors.New(
@@ -1548,11 +1585,17 @@ linters-settings:
1548
1585
- .WithMessage(
1549
1586
- .WithMessagef(
1550
1587
- .WithStack(
1588
+ # An array of strings that specify regular expressions of signatures to ignore.
1589
+ # Default: []
1551
1590
ignoreSigRegexps :
1552
1591
- \.New.*Error\(
1592
+ # An array of strings that specify globs of packages to ignore.
1593
+ # Default: []
1553
1594
ignorePackageGlobs :
1554
1595
- encoding/*
1555
1596
- github.com/pkg/*
1597
+ # An array of strings that specify regular expressions of interfaces to ignore.
1598
+ # Default: []
1556
1599
ignoreInterfaceRegexps :
1557
1600
- ^(?i)c(?-i)ach(ing|e)
1558
1601
0 commit comments