|
1 | | -run: |
2 | | - timeout: 15m |
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + timeout: 15m |
| 4 | + |
3 | 5 | linters: |
4 | | - disable-all: true |
| 6 | + default: none |
5 | 7 | enable: |
6 | | - - asciicheck |
7 | | - - bodyclose |
8 | | - - copyloopvar |
9 | | - - depguard |
10 | | - - dogsled |
11 | | - - durationcheck |
12 | | - - gci |
13 | | - - gochecknoinits |
14 | | - - gocritic |
15 | | - - gofmt |
16 | | - - gofumpt |
17 | | - - goimports |
18 | | - - goprintffuncname |
19 | | - - gosimple |
20 | | - - govet |
21 | | - - ineffassign |
22 | | - - misspell |
23 | | - - nolintlint |
24 | | - - nonamedreturns |
25 | | - - prealloc |
26 | | - - revive |
27 | | - - sloglint |
28 | | - - staticcheck |
29 | | - - stylecheck |
30 | | - - unconvert |
31 | | - - unused |
32 | | - - whitespace |
33 | | -linters-settings: |
34 | | - gci: |
35 | | - sections: |
36 | | - - standard |
37 | | - - default |
38 | | - - prefix(github.com/flant/) |
39 | | - goimports: |
40 | | - local-prefixes: github.com/flant/ |
41 | | - sloglint: |
42 | | - # Enforce not mixing key-value pairs and attributes. |
| 8 | + - asciicheck |
| 9 | + - bodyclose |
| 10 | + - copyloopvar |
| 11 | + - depguard |
| 12 | + - dogsled |
| 13 | + - durationcheck |
| 14 | + - gochecknoinits |
| 15 | + - gocritic |
| 16 | + - goprintffuncname |
| 17 | + - govet |
| 18 | + - ineffassign |
| 19 | + - misspell |
| 20 | + - nolintlint |
| 21 | + - nonamedreturns |
| 22 | + - prealloc |
| 23 | + - revive |
| 24 | + - sloglint |
| 25 | + - staticcheck |
| 26 | + - unconvert |
| 27 | + - unused |
| 28 | + - whitespace |
| 29 | + settings: |
| 30 | + depguard: |
| 31 | + rules: |
| 32 | + Main: |
| 33 | + files: |
| 34 | + - $all |
| 35 | + deny: |
| 36 | + - pkg: github.com/evanphx/json-patch |
| 37 | + desc: The 'github.com/evanphx/json-patch' package is superseded. Use pkg/utils/jsonpatch.go instead. |
| 38 | + - pkg: gopkg.in/satori/go.uuid.v1 |
| 39 | + desc: Use https://github.com/gofrs/uuid instead. Satori/go.uuid is no longer maintained and has critical vulnerabilities. |
| 40 | + nonamedreturns: |
| 41 | + report-error-in-defer: false |
| 42 | + sloglint: |
43 | 43 | no-mixed-args: true |
44 | | - # Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only). |
45 | 44 | kv-only: false |
46 | | - # Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only). |
47 | 45 | attr-only: false |
48 | | - # Enforce not using global loggers. |
49 | 46 | no-global: "" |
50 | | - # Enforce using methods that accept a context. |
51 | 47 | context: "" |
52 | | - # Enforce using static values for log messages. |
53 | 48 | static-msg: false |
54 | | - # Enforce using constants instead of raw keys. |
55 | 49 | no-raw-keys: false |
56 | | - # Enforce a single key naming convention. |
57 | | - key-naming-case: "" |
58 | | - # Enforce not using specific keys. |
59 | 50 | forbidden-keys: |
60 | 51 | - level |
61 | 52 | - msg |
62 | 53 | - logger |
63 | 54 | - source |
64 | 55 | - stacktrace |
65 | 56 | - time |
66 | | - # Enforce putting arguments on separate lines. |
67 | 57 | args-on-sep-lines: false |
68 | | - depguard: |
| 58 | + staticcheck: |
| 59 | + checks: |
| 60 | + - all |
| 61 | + - '-QF1008' # not need to fix; we understand how to call nested structs |
| 62 | + exclusions: |
| 63 | + generated: lax |
| 64 | + presets: |
| 65 | + - comments |
| 66 | + - common-false-positives |
| 67 | + - legacy |
| 68 | + - std-error-handling |
69 | 69 | rules: |
70 | | - Main: |
71 | | - files: |
72 | | - - $all |
73 | | - deny: |
74 | | - - pkg: "github.com/evanphx/json-patch" |
75 | | - desc: "The 'github.com/evanphx/json-patch' package is superseded. Use pkg/utils/jsonpatch.go instead." |
76 | | - - pkg: "gopkg.in/satori/go.uuid.v1" |
77 | | - desc: "Use https://github.com/gofrs/uuid instead. Satori/go.uuid is no longer maintained and has critical vulnerabilities." |
78 | | - nonamedreturns: |
79 | | - # Report named error if it is assigned inside defer. |
80 | | - # Default: false |
81 | | - report-error-in-defer: false |
| 70 | + - path: (.+)\.go$ |
| 71 | + text: 'var-naming: don''t use an underscore in package name' |
| 72 | + - path: (.+)\.go$ |
| 73 | + text: 'ST1003: should not use underscores in package names' |
| 74 | + - path: (.+)\.go$ |
| 75 | + text: 'ST1005: error strings should not be capitalized' |
| 76 | + - path: (.+)\.go$ |
| 77 | + text: 'error-strings: error strings should not be capitalized or end with punctuation or a newline' |
| 78 | + - path: (.+)\.go$ |
| 79 | + text: 'ST1005: error strings should not end with punctuation or newlines' |
| 80 | + - path: (.+)\.go$ |
| 81 | + text: 'dot-imports: should not use dot imports' |
| 82 | + - path: (.+)\.go$ |
| 83 | + text: 'ST1001: should not use dot imports' |
| 84 | + - path: (.+)\.go$ |
| 85 | + text: don't use `init` function |
| 86 | + - path: (.+)\.go$ |
| 87 | + text: 'var-naming:' |
| 88 | + - path: (.+)\.go$ |
| 89 | + text: 'ST1003: ' |
| 90 | + - path: (.+)\.go$ |
| 91 | + text: 'exported: type name will be used as' |
| 92 | + - path: (.+)\.go$ |
| 93 | + text: 'unexported-return: exported func NewModuleManager' |
| 94 | + paths: |
| 95 | + - third_party$ |
| 96 | + - builtin$ |
| 97 | + - examples$ |
82 | 98 | issues: |
83 | | - exclude: |
84 | | - # Using underscores is a common practice, refactor in the future |
85 | | - - "var-naming: don't use an underscore in package name" # revive |
86 | | - - "ST1003: should not use underscores in package names" # stylecheck |
87 | | - |
88 | | - # Sometime errors are used to propagate messages for end-users |
89 | | - - "ST1005: error strings should not be capitalized" # stylecheck |
90 | | - - "error-strings: error strings should not be capitalized or end with punctuation or a newline" # revive |
91 | | - - "ST1005: error strings should not end with punctuation or newlines" # stylecheck |
92 | | - |
93 | | - # Dot imports are used for types, consider refactoring |
94 | | - - "dot-imports: should not use dot imports" # revive |
95 | | - - "ST1001: should not use dot imports" # stylecheck |
96 | | - |
97 | | - # Init functions are used for global variables' initialization, consider refactoring |
98 | | - - "don't use `init` function" |
99 | | - |
100 | | - # Suggests changing Json -> JSON. Figure out which style we want to follow. |
101 | | - - "var-naming:" # revive |
102 | | - - "ST1003: " # stylecheck |
103 | | - |
104 | | - # Exported name should not start with the package name, e.g., helm3.Helm3Options. |
105 | | - # However, this penetrates all the code and sometimes is used to avoid name collisions. |
106 | | - # Nice to refactor, but not necessary. |
107 | | - - "exported: type name will be used as" # revive |
108 | | - |
109 | | - # Do not know why, but a complicated thing to refactor. Let it be for now. |
110 | | - - "unexported-return: exported func NewModuleManager" # revive |
111 | 99 | max-issues-per-linter: 0 |
112 | 100 | max-same-issues: 0 |
| 101 | +formatters: |
| 102 | + enable: |
| 103 | + - gci |
| 104 | + - gofmt |
| 105 | + - gofumpt |
| 106 | + - goimports |
| 107 | + settings: |
| 108 | + gci: |
| 109 | + sections: |
| 110 | + - standard |
| 111 | + - default |
| 112 | + - prefix(github.com/flant/) |
| 113 | + goimports: |
| 114 | + local-prefixes: |
| 115 | + - github.com/flant/ |
| 116 | + exclusions: |
| 117 | + generated: lax |
| 118 | + paths: |
| 119 | + - third_party$ |
| 120 | + - builtin$ |
| 121 | + - examples$ |
0 commit comments