@@ -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 :
@@ -934,6 +956,7 @@ linters-settings:
934
956
# Default: false
935
957
no-extra-aliases : true
936
958
# List of aliases
959
+ # Default: []
937
960
alias :
938
961
# Using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package.
939
962
- pkg : knative.dev/serving/pkg/apis/serving/v1
@@ -1000,6 +1023,7 @@ linters-settings:
1000
1023
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
1001
1024
# Default is to use a neutral variety of English.
1002
1025
locale : US
1026
+ # Default: []
1003
1027
ignore-words :
1004
1028
- someword
1005
1029
@@ -1015,7 +1039,7 @@ linters-settings:
1015
1039
1016
1040
nilnil :
1017
1041
# Checks that there is no simultaneous return of `nil` error and an invalid value.
1018
- # Default: ptr, func, iface, map, chan
1042
+ # Default: [" ptr", " func", " iface", " map", " chan"]
1019
1043
checked-types :
1020
1044
- ptr
1021
1045
- func
@@ -1074,6 +1098,7 @@ linters-settings:
1074
1098
# Default: false
1075
1099
strict : true
1076
1100
# Please refer to https://github.com/yeya24/promlinter#usage for detailed usage.
1101
+ # Default: []
1077
1102
disabled-linters :
1078
1103
- Help
1079
1104
- MetricUnits
@@ -1423,28 +1448,35 @@ linters-settings:
1423
1448
disabled : false
1424
1449
1425
1450
rowserrcheck :
1451
+ # database/sql is always checked
1452
+ # Default: []
1426
1453
packages :
1427
1454
- github.com/jmoiron/sqlx
1428
1455
1429
1456
staticcheck :
1430
1457
# Select the Go version to target.
1431
- # Default: 1.13
1458
+ # Default: " 1.13"
1432
1459
go : " 1.15"
1433
1460
# https://staticcheck.io/docs/options#checks
1461
+ # Default: ["*"]
1434
1462
checks : [ "all" ]
1435
1463
1436
1464
stylecheck :
1437
1465
# Select the Go version to target.
1438
1466
# Default: 1.13
1439
1467
go : " 1.15"
1440
1468
# https://staticcheck.io/docs/options#checks
1469
+ # Default: ["*"]
1441
1470
checks : [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
1442
1471
# https://staticcheck.io/docs/options#dot_import_whitelist
1472
+ # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"]
1443
1473
dot-import-whitelist :
1444
1474
- fmt
1445
1475
# https://staticcheck.io/docs/options#initialisms
1446
- 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" ]
1476
+ # 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"]
1477
+ 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" ]
1447
1478
# https://staticcheck.io/docs/options#http_status_code_whitelist
1479
+ # Default: ["200", "400", "404", "500"]
1448
1480
http-status-code-whitelist : [ "200", "400", "404", "500" ]
1449
1481
1450
1482
tagliatelle :
@@ -1453,6 +1485,8 @@ linters-settings:
1453
1485
# Use the struct field name to check the name of the struct tag.
1454
1486
# Default: false
1455
1487
use-field-name : true
1488
+ # `camel` is used for `json` and `yaml` (can be overridden)
1489
+ # Default: {}
1456
1490
rules :
1457
1491
# Any struct tag type can be used.
1458
1492
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
@@ -1465,11 +1499,13 @@ linters-settings:
1465
1499
1466
1500
tenv :
1467
1501
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
1468
- # By default, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
1502
+ # Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
1503
+ # Default: false
1469
1504
all : false
1470
1505
1471
1506
testpackage :
1472
- # regexp pattern to skip files
1507
+ # Regexp pattern to skip files.
1508
+ # Default: "(export|internal)_test\\.go"
1473
1509
skip-regexp : (export|internal)_test\.go
1474
1510
1475
1511
thelper :
@@ -1564,6 +1600,7 @@ linters-settings:
1564
1600
# An array of strings that specify substrings of signatures to ignore.
1565
1601
# If this set, it will override the default set of ignored signatures.
1566
1602
# See https://github.com/tomarrell/wrapcheck#configuration for more information.
1603
+ # Default: [".Errorf(", "errors.New(", "errors.Unwrap(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("]
1567
1604
ignoreSigs :
1568
1605
- .Errorf(
1569
1606
- errors.New(
@@ -1573,11 +1610,17 @@ linters-settings:
1573
1610
- .WithMessage(
1574
1611
- .WithMessagef(
1575
1612
- .WithStack(
1613
+ # An array of strings that specify regular expressions of signatures to ignore.
1614
+ # Default: []
1576
1615
ignoreSigRegexps :
1577
1616
- \.New.*Error\(
1617
+ # An array of strings that specify globs of packages to ignore.
1618
+ # Default: []
1578
1619
ignorePackageGlobs :
1579
1620
- encoding/*
1580
1621
- github.com/pkg/*
1622
+ # An array of strings that specify regular expressions of interfaces to ignore.
1623
+ # Default: []
1581
1624
ignoreInterfaceRegexps :
1582
1625
- ^(?i)c(?-i)ach(ing|e)
1583
1626
0 commit comments