|
1 | | -linters-settings: |
2 | | - exhaustive: |
3 | | - default-signifies-exhaustive: true |
4 | | - |
5 | | - gocritic: |
6 | | - # The list of supported checkers can be find in https://go-critic.github.io/overview. |
7 | | - settings: |
8 | | - underef: |
9 | | - # Whether to skip (*x).method() calls where x is a pointer receiver. |
10 | | - skipRecvDeref: false |
11 | | - |
12 | | - govet: |
13 | | - enable-all: true |
14 | | - disable: |
15 | | - - fieldalignment # too strict |
16 | | - - shadow # complains too much about shadowing errors. All research points to this being fine. |
17 | | - |
18 | | - nakedret: |
19 | | - max-func-lines: 0 |
20 | | - |
21 | | - nolintlint: |
22 | | - allow-no-explanation: [ forbidigo, tracecheck, gomnd, gochecknoinits, makezero ] |
23 | | - require-explanation: true |
24 | | - require-specific: true |
25 | | - |
26 | | - revive: |
27 | | - ignore-generated-header: true |
28 | | - severity: error |
29 | | - rules: |
30 | | - - name: atomic |
31 | | - - name: line-length-limit |
32 | | - arguments: [ 200 ] |
33 | | - # These are functions that we use without checking the errors often. Most of these can't return an error even |
34 | | - # though they implement an interface that can. |
35 | | - - name: unhandled-error |
36 | | - arguments: |
37 | | - - fmt.Printf |
38 | | - - fmt.Println |
39 | | - - fmt.Fprint |
40 | | - - fmt.Fprintf |
41 | | - - fmt.Fprintln |
42 | | - - os.Stderr.Sync |
43 | | - - sb.WriteString |
44 | | - - buf.WriteString |
45 | | - - hasher.Write |
46 | | - - os.Setenv |
47 | | - - os.RemoveAll |
48 | | - - name: var-naming |
49 | | - arguments: [["ID", "URL", "HTTP", "API"], []] |
50 | | - |
51 | | - tenv: |
52 | | - all: true |
53 | | - |
54 | | - |
| 1 | +version: "2" |
55 | 2 | linters: |
56 | | - disable-all: true |
| 3 | + default: none |
57 | 4 | enable: |
58 | | - - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases |
59 | | - - gosimple # Linter for Go source code that specializes in simplifying a code |
60 | | - - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string |
61 | | - - ineffassign # Detects when assignments to existing variables are not used |
62 | | - - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks |
63 | | - - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code |
64 | | - - unused # Checks Go code for unused constants, variables, functions and types |
65 | | - - asasalint # Check for pass []any as any in variadic func(...any) |
66 | | - - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers |
67 | | - - bidichk # Checks for dangerous unicode character sequences |
68 | | - - bodyclose # checks whether HTTP response body is closed successfully |
69 | | - - durationcheck # check for two durations multiplied together |
70 | | - - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. |
71 | | - # https://github.com/1uf3/execinquery is archived so golangci-lint warns/errors about it |
72 | | - # - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds |
73 | | - - exhaustive # check exhaustiveness of enum switch statements |
74 | | - - forbidigo # Forbids identifiers |
75 | | - - gochecknoinits # Checks that no init functions are present in Go code |
76 | | - - goconst # Finds repeated strings that could be replaced by a constant |
77 | | - - gocritic # Provides diagnostics that check for bugs, performance and style issues. |
78 | | - - godot # Check if comments end in a period |
79 | | - - goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt. |
80 | | -# Need this disabled for now, we need to have a replace |
81 | | -# - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. |
82 | | - - goprintffuncname # Checks that printf-like functions are named with f at the end |
83 | | - - gosec # Inspects source code for security problems |
84 | | - - nakedret # Finds naked returns in functions greater than a specified function length |
85 | | - - nilerr # Finds the code that returns nil even if it checks that the error is not nil. |
86 | | - - noctx # noctx finds sending http request without context.Context |
87 | | - - nolintlint # Reports ill-formed or insufficient nolint directives |
88 | | - - nonamedreturns # Reports all named returns |
89 | | - - nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL. |
90 | | - - predeclared # find code that shadows one of Go's predeclared identifiers |
91 | | - - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. |
92 | | - - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 |
93 | | - - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes |
94 | | - - unconvert # Remove unnecessary type conversions |
95 | | - - usestdlibvars # detect the possibility to use variables/constants from the Go standard library |
96 | | - - whitespace # Tool for detection of leading and trailing whitespace |
97 | | - |
| 5 | + - asasalint |
| 6 | + - asciicheck |
| 7 | + - bidichk |
| 8 | + - bodyclose |
| 9 | + - durationcheck |
| 10 | + - errcheck |
| 11 | + - errorlint |
| 12 | + - exhaustive |
| 13 | + - forbidigo |
| 14 | + - gochecknoinits |
| 15 | + - goconst |
| 16 | + - gocritic |
| 17 | + - godot |
| 18 | + - goprintffuncname |
| 19 | + - gosec |
| 20 | + - govet |
| 21 | + - ineffassign |
| 22 | + - nakedret |
| 23 | + - nilerr |
| 24 | + - noctx |
| 25 | + - nolintlint |
| 26 | + - nonamedreturns |
| 27 | + - nosprintfhostport |
| 28 | + - predeclared |
| 29 | + - revive |
| 30 | + - staticcheck |
| 31 | + - tparallel |
| 32 | + - unconvert |
| 33 | + - unused |
| 34 | + - usestdlibvars |
| 35 | + - whitespace |
| 36 | + settings: |
| 37 | + exhaustive: |
| 38 | + default-signifies-exhaustive: true |
| 39 | + gocritic: |
| 40 | + settings: |
| 41 | + underef: |
| 42 | + skipRecvDeref: false |
| 43 | + govet: |
| 44 | + disable: |
| 45 | + - fieldalignment |
| 46 | + - shadow |
| 47 | + enable-all: true |
| 48 | + nakedret: |
| 49 | + max-func-lines: 0 |
| 50 | + nolintlint: |
| 51 | + require-explanation: true |
| 52 | + require-specific: true |
| 53 | + allow-no-explanation: |
| 54 | + - forbidigo |
| 55 | + - tracecheck |
| 56 | + - gomnd |
| 57 | + - gochecknoinits |
| 58 | + - makezero |
| 59 | + revive: |
| 60 | + severity: error |
| 61 | + rules: |
| 62 | + - name: atomic |
| 63 | + - name: line-length-limit |
| 64 | + arguments: |
| 65 | + - 200 |
| 66 | + - name: unhandled-error |
| 67 | + arguments: |
| 68 | + - fmt.Printf |
| 69 | + - fmt.Println |
| 70 | + - fmt.Fprint |
| 71 | + - fmt.Fprintf |
| 72 | + - fmt.Fprintln |
| 73 | + - os.Stderr.Sync |
| 74 | + - sb.WriteString |
| 75 | + - buf.WriteString |
| 76 | + - hasher.Write |
| 77 | + - os.Setenv |
| 78 | + - os.RemoveAll |
| 79 | + - name: var-naming |
| 80 | + arguments: |
| 81 | + - - ID |
| 82 | + - URL |
| 83 | + - HTTP |
| 84 | + - API |
| 85 | + - [] |
| 86 | + exclusions: |
| 87 | + generated: lax |
| 88 | + presets: |
| 89 | + - comments |
| 90 | + - common-false-positives |
| 91 | + - legacy |
| 92 | + - std-error-handling |
| 93 | + rules: |
| 94 | + - linters: |
| 95 | + - godot |
| 96 | + source: (TODO) |
| 97 | + paths: |
| 98 | + - third_party$ |
| 99 | + - builtin$ |
| 100 | + - examples$ |
98 | 101 | issues: |
99 | 102 | max-same-issues: 50 |
100 | | - |
101 | | - exclude-rules: |
102 | | - # Don't require TODO comments to end in a period |
103 | | - - source: "(TODO)" |
104 | | - linters: [ godot ] |
| 103 | +formatters: |
| 104 | + enable: |
| 105 | + - goimports |
| 106 | + exclusions: |
| 107 | + generated: lax |
| 108 | + paths: |
| 109 | + - third_party$ |
| 110 | + - builtin$ |
| 111 | + - examples$ |
0 commit comments