|
1 | 1 | # yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json |
2 | | -# docs: https://github.com/golangci/golangci-lint#config-file |
| 2 | +# docs: https://golangci-lint.run/usage/configuration/ |
| 3 | +version: "2" |
3 | 4 |
|
4 | 5 | run: |
5 | | - timeout: 2m |
6 | 6 | modules-download-mode: readonly |
7 | 7 | allow-parallel-runners: true |
8 | 8 |
|
9 | 9 | output: |
10 | | - formats: [{format: colored-line-number}] # colored-line-number|line-number|json|tab|checkstyle|code-climate |
| 10 | + formats: {text: {path: stdout}} |
11 | 11 |
|
12 | | -linters-settings: |
13 | | - gci: |
14 | | - sections: |
15 | | - - standard |
16 | | - - default |
17 | | - - prefix(gh.tarampamp.am/error-pages) |
18 | | - gofmt: |
19 | | - simplify: false |
20 | | - rewrite-rules: |
21 | | - - { pattern: 'interface{}', replacement: 'any' } |
22 | | - govet: |
23 | | - enable: |
24 | | - - shadow |
25 | | - gocyclo: |
26 | | - min-complexity: 15 |
27 | | - godot: |
28 | | - scope: declarations |
29 | | - capital: false |
30 | | - dupl: |
31 | | - threshold: 100 |
32 | | - goconst: |
33 | | - min-len: 2 |
34 | | - min-occurrences: 3 |
35 | | - misspell: |
36 | | - locale: US |
37 | | - ignore-words: [cancelled] |
38 | | - lll: |
39 | | - line-length: 120 |
40 | | - forbidigo: |
41 | | - forbid: |
42 | | - - '^(fmt\.Print(|f|ln)|print(|ln))(# it looks like a forgotten debugging printing call)?$' |
43 | | - prealloc: |
44 | | - simple: true |
45 | | - range-loops: true |
46 | | - for-loops: true |
47 | | - nolintlint: |
48 | | - require-specific: true |
49 | | - nakedret: |
50 | | - # Make an issue if func has more lines of code than this setting, and it has naked returns. |
51 | | - # Default: 30 |
52 | | - max-func-lines: 100 |
53 | | - |
54 | | -linters: # All available linters list: <https://golangci-lint.run/usage/linters/> |
55 | | - disable-all: true |
| 12 | +linters: |
| 13 | + default: none |
56 | 14 | enable: |
57 | | - - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers |
58 | | - - bidichk # Checks for dangerous unicode character sequences |
59 | | - - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) |
60 | | - - dupl # Tool for code clone detection |
61 | | - - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases |
62 | | - - errorlint # find code that will cause problems with the error wrapping scheme introduced in Go 1.13 |
63 | | - - exhaustive # check exhaustiveness of enum switch statements |
64 | | - - copyloopvar # detects places where loop variables are copied |
65 | | - - funlen # Tool for detection of long functions |
66 | | - - gci # Gci control golang package import order and make it always deterministic |
67 | | - - godot # Check if comments end in a period |
68 | | - - gochecknoglobals # Checks that no globals are present in Go code |
69 | | - - gochecknoinits # Checks that no init functions are present in Go code |
70 | | - - gocognit # Computes and checks the cognitive complexity of functions |
71 | | - - goconst # Finds repeated strings that could be replaced by a constant |
72 | | - - gocritic # The most opinionated Go source code linter |
73 | | - - gocyclo # Computes and checks the cyclomatic complexity of functions |
74 | | - - gofmt # Gofmt checks whether code was gofmt-ed. By default, this tool runs with -s option to check for code simplification |
75 | | - - goimports # Goimports does everything that gofmt does. Additionally, it checks unused imports |
76 | | - - mnd # An analyzer to detect magic numbers |
77 | | - - goprintffuncname # Checks that printf-like functions are named with `f` at the end |
78 | | - - gosec # Inspects source code for security problems |
79 | | - - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string |
80 | | - - ineffassign # Detects when assignments to existing variables are not used |
81 | | - - lll # Reports long lines |
82 | | - - forbidigo # Forbids identifiers |
83 | | - - misspell # Finds commonly misspelled English words in comments |
84 | | - - nakedret # Finds naked returns in functions greater than a specified function length |
85 | | - - nestif # Reports deeply nested if statements |
86 | | - - nlreturn # checks for a new line before return and branch statements to increase code clarity |
87 | | - - nolintlint # Reports ill-formed or insufficient nolint directives |
88 | | - - prealloc # Finds slice declarations that could potentially be preallocated |
89 | | - - promlinter # Check Prometheus metrics naming via promlint. |
90 | | - - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code |
91 | | - - unconvert # Remove unnecessary type conversions |
92 | | - - whitespace # Tool for detection of leading and trailing whitespace |
93 | | - - wsl # Whitespace Linter - Forces you to use empty lines! |
94 | | - - unused # Checks Go code for unused constants, variables, functions and types |
95 | | - - gosimple # Linter for Go source code that specializes in simplifying code |
96 | | - - staticcheck # It's a set of rules from staticcheck |
97 | | - - asasalint # Check for pass []any as any in variadic func(...any) |
98 | | - - bodyclose # Checks whether HTTP response body is closed successfully |
99 | | - - contextcheck # Check whether the function uses a non-inherited context |
100 | | - - decorder # Check declaration order and count of types, constants, variables and functions |
101 | | - - dupword # Checks for duplicate words in the source code |
102 | | - - durationcheck # Check for two durations multiplied together |
103 | | - - errchkjson # Checks types passed to the json encoding functions |
104 | | - - errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error |
105 | | - |
106 | | -issues: |
107 | | - exclude-dirs: |
108 | | - - .github |
109 | | - - .git |
110 | | - - tmp |
111 | | - - temp |
112 | | - - testdata |
113 | | - exclude-rules: |
114 | | - - {path: flags\.go, linters: [gochecknoglobals, lll, mnd, dupl]} |
115 | | - - {path: env\.go, linters: [lll, gosec]} |
116 | | - - path: _test\.go |
117 | | - linters: |
118 | | - - dupl |
119 | | - - dupword |
120 | | - - lll |
121 | | - - nolintlint |
122 | | - - funlen |
123 | | - - gocognit |
124 | | - - noctx |
125 | | - - goconst |
126 | | - - nlreturn |
127 | | - - gochecknoglobals |
| 15 | + - asasalint |
| 16 | + - asciicheck |
| 17 | + - bidichk |
| 18 | + - bodyclose |
| 19 | + - contextcheck |
| 20 | + - copyloopvar |
| 21 | + - decorder |
| 22 | + - dogsled |
| 23 | + - dupl |
| 24 | + - dupword |
| 25 | + - durationcheck |
| 26 | + - errcheck |
| 27 | + - errchkjson |
| 28 | + - errname |
| 29 | + - errorlint |
| 30 | + - exhaustive |
| 31 | + - forbidigo |
| 32 | + - funlen |
| 33 | + - gochecknoglobals |
| 34 | + - gochecknoinits |
| 35 | + - gocognit |
| 36 | + - goconst |
| 37 | + - gocritic |
| 38 | + - gocyclo |
| 39 | + - godot |
| 40 | + - goprintffuncname |
| 41 | + - gosec |
| 42 | + - govet |
| 43 | + - ineffassign |
| 44 | + - lll |
| 45 | + - misspell |
| 46 | + - mnd |
| 47 | + - nakedret |
| 48 | + - nestif |
| 49 | + - nlreturn |
| 50 | + - nolintlint |
| 51 | + - prealloc |
| 52 | + - promlinter |
| 53 | + - staticcheck |
| 54 | + - unconvert |
| 55 | + - unused |
| 56 | + - whitespace |
| 57 | + - wsl |
| 58 | + settings: |
| 59 | + dupl: |
| 60 | + threshold: 100 |
| 61 | + forbidigo: |
| 62 | + forbid: |
| 63 | + - pattern: ^(fmt\.Print(|f|ln)|print(|ln))(# it looks like a forgotten debugging printing call)?$ |
| 64 | + goconst: |
| 65 | + min-len: 2 |
| 66 | + min-occurrences: 3 |
| 67 | + gocyclo: |
| 68 | + min-complexity: 15 |
| 69 | + godot: |
| 70 | + scope: declarations |
| 71 | + capital: false |
| 72 | + govet: |
| 73 | + enable: |
| 74 | + - shadow |
| 75 | + lll: |
| 76 | + line-length: 120 |
| 77 | + misspell: |
| 78 | + locale: US |
| 79 | + ignore-rules: |
| 80 | + - cancelled |
| 81 | + nakedret: |
| 82 | + max-func-lines: 100 |
| 83 | + nolintlint: |
| 84 | + require-specific: true |
| 85 | + prealloc: |
| 86 | + simple: true |
| 87 | + range-loops: true |
| 88 | + for-loops: true |
| 89 | + exclusions: |
| 90 | + generated: lax |
| 91 | + presets: |
| 92 | + - comments |
| 93 | + - common-false-positives |
| 94 | + - legacy |
| 95 | + - std-error-handling |
| 96 | + rules: |
| 97 | + - linters: |
| 98 | + - dupl |
| 99 | + - gochecknoglobals |
| 100 | + - lll |
| 101 | + - mnd |
| 102 | + path: flags\.go |
| 103 | + - linters: |
| 104 | + - gosec |
| 105 | + - lll |
| 106 | + path: env\.go |
| 107 | + - linters: |
| 108 | + - dupl |
| 109 | + - dupword |
| 110 | + - funlen |
| 111 | + - gochecknoglobals |
| 112 | + - gocognit |
| 113 | + - goconst |
| 114 | + - lll |
| 115 | + - nlreturn |
| 116 | + - noctx |
| 117 | + - nolintlint |
| 118 | + path: _test\.go |
| 119 | + paths: |
| 120 | + - .github |
| 121 | + - .git |
| 122 | + - tmp |
| 123 | + - temp |
| 124 | + - testdata |
| 125 | + - third_party$ |
| 126 | + - builtin$ |
| 127 | + - examples$ |
| 128 | +formatters: |
| 129 | + enable: |
| 130 | + - gci |
| 131 | + - gofmt |
| 132 | + - goimports |
| 133 | + settings: |
| 134 | + gci: |
| 135 | + sections: |
| 136 | + - standard |
| 137 | + - default |
| 138 | + - prefix(gh.tarampamp.am/error-pages) |
| 139 | + gofmt: |
| 140 | + simplify: false |
| 141 | + rewrite-rules: |
| 142 | + - pattern: interface{} |
| 143 | + replacement: any |
| 144 | + exclusions: |
| 145 | + generated: lax |
| 146 | + paths: |
| 147 | + - .github |
| 148 | + - .git |
| 149 | + - tmp |
| 150 | + - temp |
| 151 | + - testdata |
| 152 | + - third_party$ |
| 153 | + - builtin$ |
| 154 | + - examples$ |
0 commit comments