-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.toml
649 lines (565 loc) · 34.4 KB
/
.golangci.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
[linters]
# This file is intended to be used by your IDE to show you what linting
# issues exist in the code as you work on it. This list of linters will be
# run against the files you change in a PR, but won't report problems in
# files you don't touch.
#
# To see what issues will be present on just the PR files, you can run
# golangci-lint run --new-from-rev=origin/main
# We set all to enabled and disable the ones we don't like. This is better
# than the reverse, because when we update golangci-lint and get more
# linters, they'll either be noisy, and we'll know to silence them, or they
# won't be, and it won't matter. With the reverse, you have to go looking
# for new linters to turn on.
enable-all = true
enable = [
# These are commented out because you can't use both the enable list and
# the disable list. This is formatted like the disable list, so you can
# move linters down to the disable list easily.
# You can get a full list of enabled and disabled linters by running
# golangci-lint linters, which might show more enabled linters than are
# here, if new linters have been added recently and not referenced here.
# "asasalint", # check for pass []any as any in variadic func(...any)
# # could be a common error, probably low false positives
# "bidichk", # Checks for dangerous unicode character sequences
# # ? it's new
# "bodyclose", # checks whether HTTP response body is closed successfully
# # Forgetting to close an HTTP body can be a memory leak
# "contextcheck", # checks that you pas a context you already have, down into other methods
# # # this is good, so you pass down cancellation etc too.
# "depguard", # checks if package imports are in a list of acceptable packages
# # this is useful for ensuring people use the company-standard packages for logging etc.
# "durationcheck", # check for two durations multiplied together
# # this is probably a rare bug, but should have basically zero false positives.
# "errchkjson", # ensures that you check the error if you're json encoding/decoding types that could fail
# # this is a fairly common error that should rarely get ignored
# "errname", # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
# # This is standard practice and makes it easy to find error types and sentinels in the code.
# "errorlint", # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
# # This ensures you use errors.Is instead of == to compare errors, to avoid bugs with wrapping.
# "exportloopref", # catch bugs resulting from referencing variables on range scope
# # variables initialized in for loops change with each loop, which can cause bugs.
# "forcetypeassert", # finds type asserts where you don't use the v, ok format
# # if you do v := foo.(bar) and foo is not a bar, this will panic, and that's bad.
# "gochecknoinits", # Checks that no init functions are present in Go code
# # init is bad, and is almost never necessary, nor is it a good idea.
# "gocritic", # Provides many diagnostics that check for bugs, performance and style issues.
# # This is highly configurable, see the gocritic config section below.
# "goimports", # check that all code is formatted with goimports
# # Formating is good. goimports is better (and formats imports slightly differently than gofmt).
# "godot", # Check if comments end in a period
# # this is a recommended Go style, and not only makes your doc comments look more
# # professional, it ensures that you don't stop a comment in the middle and forget
# # to write the end of it.
# "gosec", # Inspects source code for security problems
# # high quality linter that finds real bugs
# "gosimple", # tells you where you can simplify your code
# # simple is good
# "govet", # reports suspicious constructs like printf calls that don't have the right # of arguments
# # high quality, low false positives
# "ineffassign", # Detects when assignments to existing variables are not used
# # this finds bugs all the time, where you assign to a value but then never use
# # the assigned value due to shadowing etc.
# "makezero", # checks that you don't accidentally make a slice w/ nonzero length and then append to it
# # this can cause bugs where you make a slice of length 5 and then append 5 items to it,
# # giving you a length of 10 where the first 5 are all zero values.
# "misspell", # Finds commonly misspelled English words in comments
# # we all suck at spelling and tpying
# "nakedret", # Finds naked returns in functions greater than a specified function length
# # naked returns are evil
# "nestif", # Reports deeply nested if statements
# # deeply nested ifs are hard to read
# "noctx", # noctx finds sending http request without context.Context
# # you should always use context so we can cancel external requests
# "nolintlint", # Reports ill-formed or insufficient nolint directives
# # ensures that you don't typo nolint comments. and that you justify them with why you are ignoring a linter here.
# "nilerr", # Finds the code that returns nil even if it checks that the error is not nil.
# # finds fairly common bug
# "predeclared", # find code that shadows one of Go's predeclared identifiers
# # you can make a variable called "true", but it's a bad idea.
# "revive", # finds common style mistakes
# # style and other mistakes that you really should listen to.
# "rowserrcheck", # checks whether Err of rows is checked successfully
# # finds bugs in SQL code
# "sqlclosecheck", # Checks that sql.Rows and sql.Stmt are closed.
# # easy and finds bugs
# "staticcheck", # go vet on steroids, applying a ton of static analysis checks
# # encompasses many linters in one, good stuff
# "stylecheck", # checks go style
# # we like to conform to go style conventions.
# "tenv", # checks that you use t.Setenv in tests instead of os.Setenv
# # t.Setenv will auto-undo your changes for you
# "tparallel", # tparallel detects inappropriate usage of t.Parallel()
# # likely a rare problem, but should have low false positives
# "unconvert", # Remove unnecessary type conversions
# # can save a little memory, unlikely to have false positives
# "unused", # Checks for unused constants, variables, functions and types
# # may have false positives, should watch this one
# "usestdlibvars", # detect the possibility to use variables/constants from the Go standard library
# # it's too easy to typo strings etc, might as well use well-known constants.
]
# We manually enable only the linters we want, above, so we don't need a
# manual disable list as well. See the bottom of the file for a list of
# disabled linters and why they're disabled.
disable = [
"gomoddirectives", # temporarily disabling this since golangci-lint currently doesn't support nolint directives
# in go.mod files, evidently. See https://github.com/golangci/golangci-lint/issues/3507
# List of linters supported by golangci-lint that we intentionally do not use.
# "name", # description
# reason to disable
"asciicheck", # checks that your code does not contain non-ASCII identifiers
# Honestly not sure why anyone cares?
"containedctx", # detects struct contained context.Context field
# yes, sure, you're not supposed to, but sometimes you need to.
"cyclop", # checks function and package cyclomatic complexity
# Too hard to know when you trip over this, and I feel like it needs a human
# to understand if a function is too complex.
"deadcode", # unmaintained
"dogsled", # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
# This doesn't seem to be a common problem, nor a source of bugs. It would be
# better to have a linter that just tells you not to return 4 things in the
# first place.
"dupl", # Tool for code clone detection
# This feels too likely to have high false positives on trivial code, and miss
# more complicated duplicates.
"errcheck", # finds errors that aren't checked
# duplicated by gosec, except that gosec lets us ignore errors not checked in defers.
"exhaustive", # checks exhaustiveness of enum switch statements
# This tends to hit a lot of false positives, and can lead to a lot of nolint statements.
# Definitely could be useful for specific repos of focused libraries where you know you
# update enums a lot, and want to make sure your switch statements stay up to date.
"exhaustivestruct", # deprectated
"exhaustruct", # Checks if all struct's fields are initialized
# This is generally a feature, not a bug. Requiring a //nolint whenever you partially
# initialize a struct would be pretty annoying.
"forbidigo", # Can be configured to forbids specific identifiers, like fmt.Printf, for example.
# This can actually be really useful, but needs a deep understanding of patterns
# we want devs to avoid in our specific repos. Definitely look into it if you have
# a list of "don't use XYZ" items.
"funlen", # Tool for detection of long functions
# We could maybe put this in with a pretty big size limit, but it feels like it would be
# of limited benefit and cause grumbling.
"gci", # control golang package import order and make it always deterministic
# I haven't really had a problem with this, when using goimports, so I'm not sure it's useful.
"gochecknoglobals", # check that no global variables exist
# this is actually good to have on, but I'm afraid it would cause more heartburn than good.
"gocognit", # Computes and checks the cognitive complexity of functions
# Too hard to know when you trip over this, and I feel like it needs a human
# to understand if a function is too complex.
"goconst", # Finds repeated strings that could be replaced by a constant
# magic strings are bad, but I feel like this could reduce adoption of the linter.
"gocyclo", # checks cyclomatic complexity of functions.
# While this is probably a good idea, it can be restrictive and hard to fix.
"godox", # detects use of FIXME, TODO and other comment keywords
# Ideally these should be issues, but sometimes it's useful to have them in the code, too.
"goerr113", # checks that you use errors.Is and don't define your own errors except as package variables.
# duplicates other error checking linters
"gofmt", # checks whether code was gofmt-ed.
# use goimports instead, they have slightly different formatting.
"gofumpt", # checks whether code is gofumpt-ed
# use goimports instead, they have slightly different formatting.
"goheader", # checks if file header matches a pattern
# useful for companies that mandate a copyright header on every file. That's not us.
"golint", # unmaintained
"gomnd", # an analyzer to detect magic numbers
# just too noisy
"ifshort", # makes sure you use if err := foo(); err != nil
# this is really more personal preference, and sometimes can hinder readability.
"importas", # enforces consistent import aliases
# this is kind of a special case for avoiding import collisions, and not really needed for us.
"interfacer", # unmaintined
"ireturn", # complains when you return an interface
# sometimes that's the right thing to do
"lll", # reports long lines
# duplicated by other checks
"maligned", # archived by owner
"nilnil", # reports when you return a nil error and a nil value
# while this is often misleading, there are too many valid uses
"nonamedreturns", # complains whenever you use named returns
# named returns can be good for documentation, actually
"nosnakecase", # deprecated by owner
"nlreturn", # nlreturn checks for a new line before return and branch statements to increase code clarity
# I'm not a monster, newline if you like, or not.
"paralleltest", # paralleltest detects missing usage of t.Parallel() method in your Go test
# parallel tests are good, but packages are already run in parallel, so it's not a huge gain.
"prealloc", # Finds slice declarations that could potentially be preallocated
# this can save some memory and copying, but it's too noisy to be useful.
"promlinter", # Check Prometheus metrics naming via promlint
# enable if you use prometheus
"scopelint", # unmaintained
"structcheck", # unmaintained
"tagliatelle", # Checks that struct tags match a certain format (camelcase, snakecase etc)
# likely to cause a lot of false positives if you're making tags for other people's APIs
"testpackage", # makes you use a separate _test package
# I actually think this is a bad idea in general, and I would want a linter that does the opposite.
"thelper", # detects golang test helpers without t.Helper()
# t.Helper is sometimes useful and sometimes not.
"typecheck", # parses and type-checks Go code
# probably unnecessary, and fails weirdly with a config file set with -c
"unparam", # Reports unused function parameters
# seems likely to have false positives
"varcheck", # unmaintained
"wastedassign", # finds wasted assignment statements.
# duplicates ineffassign
"whitespace", # finds extra newlines at the beginning of functions and if statements
# I like this, but I feel like it would be too nitpicky for most people
"wrapcheck", # Checks that errors returned from external packages are wrapped
# I mean, yeah, but you don't *always* need to wrap, that gets excesssive.
"wsl", # Whitespace Linter - Forces you to use empty lines!
# meh, I'm not that much of a control freak
"varnamelen", # checks length of name matches scope of use
# this is too much of a judgement call
]
[run]
# options for analysis running
# Increase timeout from default 1m, first pre-cache run can take a bit in CI/CD
timeout = "5m"
# default concurrency is the available CPU number
# concurrency = 4
# exit code when at least one issue was found, default is 1
issues-exit-code = 1
# include test files or not, default is true
tests = true
# list of build tags, all linters use it. Default is empty list.
build-tags = []
# which dirs to skip: issues from them won't be reported;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but default dirs are skipped independently
# from this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work
# on Windows.
skip-dirs = []
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default = true
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
# "/" will be replaced by current OS file path separator to properly work
# on Windows.
skip-files = []
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
modules-download-mode = ""
# Allow multiple parallel golangci-lint instances running.
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners = false
[output]
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
# default is "colored-line-number"
format = "colored-line-number"
# print lines of code with issue, default is true
print-issued-lines = true
# print linter name in the end of issue text, default is true
print-linter-name = true
# make issues output unique by line, default is true
uniq-by-line = true
# add a prefix to the output file references; default is no prefix
path-prefix = ""
# sorts results by: filepath, line and column
sort-results = true
# options to enable differentiating between error and warning severities
[severity]
# GitHub Actions annotations support error and warning only:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
default-severity = "error"
# If set to true severity-rules regular expressions become case sensitive.
# The default value is false.
case-sensitive = false
# Default value is empty list.
# When a list of severity rules are provided, severity information will be added to lint
# issues. Severity rules have the same filtering capability as exclude rules except you
# are allowed to specify one matcher per severity rule.
# Only affects out formats that support setting severity information.
# [[severity.rules]]
# linters = [
# "revive",
# ]
# severity = "warning"
[issues]
# List of regexps of issue texts to exclude, empty list by default.
# Please document every exception here so we know what we're suppressing and why.
exclude = []
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter = 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues = 0
# The default value is false. If set to true exclude and exclude-rules
# regular expressions become case sensitive.
# exclude-case-sensitive = false
# This flag suppresses lint issues from several linters, overriding any
# other configuration you have set. It defaults to true.
# NEVER remove this configuration. If you want to suppress something, do so
# explicitly elsewhere.
exclude-use-default = false
# The list of ids of default excludes to include or disable. By default it's empty.
# We shouldn't ever need this, since we turn off default excludes.
include = []
# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing
# large codebase. It's not practical to fix all existing issues at the moment
# of integration: much better don't allow issues in new code.
# Default is false.
new = false
# Show only new issues created in git patch with set file path.
# new-from-patch = "path/to/patch/file"
# Show only new issues created after git revision `REV`
# new-from-rev = "REV"
# Fix found issues (if it's supported by the linter). Default is false.
fix = false
# reduce noise in some linters that don't necessarily need to be run in tests
[[issues.exclude-rules]]
path = "_test.go"
linters = ["errcheck", "gosec", "noctx", "bodyclose", "forcetypeassert", "maintidx"]
#
# Specific Linter Settings
#
[linters-settings.depguard]
# ban some modules with replacements
list-type = "blacklist"
include-go-root = true
packages = [
# we shouldn't use pkg/error anymore
"github.com/pkg/error",
]
[[linters-settings.depguard.packages-with-error-message]]
"github.com/pkg/error" = "Please use stdlib errors module"
[linters-settings.errorlint]
# Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats
errorf = true
# Check for plain type assertions and type switches
asserts = true
# Check for plain error comparisons
comparison = true
[linters-settings.gocritic]
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags = [
"diagnostic",
"performance",
"style",
]
disabled-checks = [
# import shadow warns if a variable shadow the name of an imported package.
# kind of noisy, doesn't actually hurt anything, just may be momentarily confusing.
"importShadow",
]
# HugeParam: warn if passing huge parameters by value; consider passing pointers instead.
[linters-settings.gocritic.settings.hugeParam]
# increase threshold from default (80 bytes) to 256 bytes.
sizeThreshold = 256
# warn if looping over an exceptionally large value.
[linters-settings.gocritic.settings.rangeValCopy]
# increase threshold from default (128 bytes) to 256 bytes.
sizeThreshold = 256
[linters-settings.goimports]
# Goimports checks whether code was formatted with goimports.
# uncomment if we want to enforce having GitHub-owned packages sorted into a separate section
# local-prefixes = "github.com/github/"
[linters-settings.govet]
enable = [ "httpresponse" ]
[linters-settings.gosec]
excludes = [
"G204", # subprocess launched with variable. This is just silly most of the time.
"G304", # file inclusion via variable. As above, this is not dangerous most of the time.
"G307", # deferring methods with errors.... this is usually ok, and annoying to fix
]
[linters-settings.gosec.config.G104]
os = ["Setenv"]
[linters-settings.nestif]
min-complexity = 9
[linters-settings.nolintlint]
# adds some protections around nolint directives
# Enable to ensure that nolint directives are all used. Default is true.
allow-unused = true
# Disable to ensure that nolint directives don't have a leading space. Default is true.
allow-leading-space = true
# Exclude following linters from requiring an explanation. Default is [].
allow-no-explanation = []
# Enable to require an explanation of nonzero length after each nolint directive. Default is false.
require-explanation = true
# Enable to require nolint directives to mention the specific linter being suppressed. Default is false.
require-specific = true
[linters-settings.staticcheck]
# disable specific checks by adding them to this list with a minus sign
# please include what the code means and why it's being ignored.
# e.g. "-SA1019", # io/ioutil" has been deprecated since Go 1.16. Sure, but it still works.
checks = [
]
[linters-settings.revive]
# max-open-files = # default unlimited
ignore-generated-header = false # default
severity = "error" # default
confidence = 0.8 # default
# We enable all rules and then disable the ones we don't like.
enable-all-rules = true
# See https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
# for a full list of Revive rules. Below, we only specify the ones we want
# to disable or configure differently from the default.
[[linters-settings.revive.rules]]
# Suggests using constant for magic numbers and string literals.
name = "add-constant"
# This gets annoying and is not a huge deal
disabled = true
[[linters-settings.revive.rules]]
# Warns when a function receives more parameters than the maximum set by
# the rule's configuration. Enforcing a maximum number of parameters
# helps to keep the code readable and maintainable.
name = "argument-limit"
# This is not something that should have a hard limit.
disabled = true
[[linters-settings.revive.rules]]
# Checks given banned characters in identifiers(func, var, const).
# Comments are not checked.
name = "banned-characters"
# I mean, please don't use wacky unicode characters for no reason, but I
# don't know what weird edge cases might require some unicode
# characters.
disabled = true
[[linters-settings.revive.rules]]
# Blank import should be only in a main or test package, or have a
# comment justifying it.
name = "blank-imports"
# In general, this is a good idea, but there can be exceptions.
disabled = true
[[linters-settings.revive.rules]]
# Cognitive complexity is a measure of how hard code is to understand.
# While cyclomatic complexity is good to measure "testability" of the
# code, cognitive complexity aims to provide a more precise measure of
# the difficulty of understanding the code. Enforcing a maximum
# complexity per function helps to keep code readable and maintainable.
name = "cognitive-complexity"
# These types of rules are too arbitrary to be useful.
disabled = true
[[linters-settings.revive.rules]]
# Methods or fields of struct that have names different only by
# capitalization could be confusing.
name = "confusing-naming"
# This is often something we do when there's an exported method and an
# unexported method etc.
disabled = true
[[linters-settings.revive.rules]]
# The rule spots logical expressions that evaluate always to the same
# value.
name = "constant-logical-expr"
# This is often useful when you want to explain where a constant came
# from, like const days = 7 * 24 * time.hour
disabled = true
[[linters-settings.revive.rules]]
# Cyclomatic complexity is a measure of code complexity. Enforcing a
# maximum complexity per function helps to keep code readable and
# maintainable.
name = "cyclomatic"
# These types of rules are too arbitrary to be useful.
disabled = true
[[linters-settings.revive.rules]]
# Empty blocks make code less readable and could be a symptom of a bug
# or unfinished refactoring.
name = "empty-block"
# This can be useful when you put a comment in an empty block to explain
# why you are intentionally not doing anything on that codepath, such as
# in a default case in a switch.
disabled = true
[[linters-settings.revive.rules]]
# By convention, for the sake of readability, variables of type error must
# be named with the prefix err.
name = "error-naming"
# It is also common to end an error with err instead of starting it with
# err, so we ignore this one.
disabled = true
[[linters-settings.revive.rules]]
# This rule helps to enforce a common header for all source files in a
# project by spotting those files that do not have the specified header.
name = "file-header"
# We don't do that.
disabled = true
[[linters-settings.revive.rules]]
# If a function controls the flow of another by passing it information
# on what to do, both functions are said to be control-coupled. Coupling
# among functions must be minimized for better maintainability of the
# code. This rule warns on boolean parameters that create a control
# coupling.
name = "flag-parameter"
# While this is generally a good thing to avoid, it sometimes is the
# clearest way to write the code.
disabled = true
[[linters-settings.revive.rules]]
# Functions returning too many results can be hard to understand/use.
name = "function-result-limit"
# Sure, but sometimes it's more clear to return a bunch of things.
disabled = true
[[linters-settings.revive.rules]]
# Functions too long (with many statements and/or lines) can be hard to
# understand.
name = "function-length"
# Too arbitrary to hard-code.
disabled = true
[[linters-settings.revive.rules]]
# Typically, functions with names prefixed with Get are supposed to
# return a value.
name = "get-return"
# This does not seem like a problem that needs fixing.
disabled = true
[[linters-settings.revive.rules]]
# Warns when importing black-listed packages.
name = "imports-blacklist"
# We do this with the another linter.
disabled = true
[[linters-settings.revive.rules]]
# Warns in the presence of code lines longer than a configured maximum.
name = "line-length-limit"
# This is too subjective.
disabled = true
[[linters-settings.revive.rules]]
# Packages declaring too many public structs can be hard to
# understand/use, and could be a symptom of bad design. This rule warns
# on files declaring more than a configured, maximum number of public
# structs.
name = "max-public-structs"
# This is too arbitrary to hardcode.
disabled = true
[[linters-settings.revive.rules]]
# Packages declaring structs that contain other inline struct
# definitions can be hard to understand/read for other developers.
name = "nested-structs"
# This is actually common practice when making config structs.
disabled = true
[[linters-settings.revive.rules]]
# conditional expressions can be written to take advantage of short
# circuit evaluation and speed up its average evaluation time by forcing
# the evaluation of less time-consuming terms before more costly ones.
# This rule spots logical expressions where the order of evaluation of
# terms seems non optimal.
name = "optimize-operands-order"
# This is too minor of a benefit and may harm readability at times.
disabled = true
[[linters-settings.revive.rules]]
# This rule allows you to configure a list of regular expressions that
# string literals in certain function calls are checked against. This is
# geared towards user facing applications where string literals are
# often used for messages that will be presented to users, so it may be
# desirable to enforce consistent formatting.
name = "string-format"
# We don't need this.
disabled = true
[[linters-settings.revive.rules]]
# This rule warns on unused parameters. Functions or methods with unused
# parameters can be a symptom of an unfinished refactoring or a bug.
name = "unused-parameter"
# This can be fairly common when fulfilling an interface.
disabled = true
[[linters-settings.revive.rules]]
# This rule warns on unused method receivers. Methods with unused
# receivers can be a symptom of an unfinished refactoring or a bug.
name = "unused-receiver"
# As above, one common need for this is when you need to fulfill an
# interface.
disabled = true