|
| 1 | +version: "2" |
1 | 2 | linters: |
2 | | - disable-all: true |
| 3 | + default: none |
3 | 4 | enable: |
4 | | - #- bodyclose |
| 5 | + - copyloopvar |
5 | 6 | - depguard |
6 | 7 | - dogsled |
7 | 8 | - dupl |
8 | 9 | - errcheck |
9 | 10 | - errorlint |
10 | | - - copyloopvar |
11 | | - #- gocritic |
12 | 11 | - gocyclo |
13 | | - - goimports |
14 | 12 | - goprintffuncname |
15 | 13 | - gosec |
16 | | - - gosimple |
17 | 14 | - govet |
18 | | - - gofmt |
| 15 | + - importas |
19 | 16 | - ineffassign |
20 | 17 | - misspell |
21 | 18 | - noctx |
22 | 19 | - prealloc |
23 | 20 | - rowserrcheck |
24 | 21 | - staticcheck |
25 | | - - stylecheck |
26 | | - - typecheck |
27 | 22 | - unconvert |
28 | 23 | - unparam |
29 | 24 | - unused |
30 | 25 | - whitespace |
31 | | - - importas |
32 | | - |
33 | | -linters-settings: |
34 | | - misspell: |
35 | | - locale: US |
36 | | - goimports: |
37 | | - local-prefixes: github.com/mongodb/mongodb-atlas-kubernetes/v2 |
38 | | - depguard: |
| 26 | + settings: |
| 27 | + staticcheck: |
| 28 | + checks: |
| 29 | + - -QF1008 # produces false positives |
| 30 | + depguard: |
| 31 | + rules: |
| 32 | + all: |
| 33 | + deny: |
| 34 | + - pkg: io/ioutil |
| 35 | + desc: io/ioutil package has been deprecated |
| 36 | + misspell: |
| 37 | + locale: US |
| 38 | + exclusions: |
| 39 | + generated: lax |
39 | 40 | rules: |
40 | | - all: |
41 | | - deny: |
42 | | - - pkg: io/ioutil |
43 | | - desc: 'io/ioutil package has been deprecated' |
44 | | - |
| 41 | + - linters: |
| 42 | + - errcheck |
| 43 | + - gochecknoglobals |
| 44 | + - gocyclo |
| 45 | + - nlreturn |
| 46 | + - wrapcheck |
| 47 | + path: test |
| 48 | + - linters: |
| 49 | + - gochecknoglobals |
| 50 | + - wrapcheck |
| 51 | + path: cmd/manager/main.go |
| 52 | + - linters: |
| 53 | + - noctx |
| 54 | + - staticcheck |
| 55 | + path: test/e2e |
| 56 | + - linters: |
| 57 | + - staticcheck |
| 58 | + path: test/helper |
| 59 | + text: 'ST1000:|ST1001:|ST1003:' |
| 60 | + - linters: |
| 61 | + - noctx |
| 62 | + path: test/helper/e2e/appclient |
| 63 | + - linters: |
| 64 | + - dupl |
| 65 | + - prealloc |
| 66 | + - unparam |
| 67 | + path: pkg/controller |
| 68 | + - linters: |
| 69 | + - prealloc |
| 70 | + path: pkg/controller/atlasdatabaseuser/connectionsecrets |
| 71 | + - linters: |
| 72 | + - staticcheck |
| 73 | + path: pkg/util/testutil/ |
| 74 | + - path: (.+)\.go$ |
| 75 | + text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
| 76 | + - path: (.+)\.go$ |
| 77 | + text: func name will be used as test\.Test.* by other packages, and that stutters; consider calling this |
| 78 | + - path: (.+)\.go$ |
| 79 | + text: (possible misuse of unsafe.Pointer|should have signature) |
| 80 | + - path: (.+)\.go$ |
| 81 | + text: Use of unsafe calls should be audited |
| 82 | + - path: (.+)\.go$ |
| 83 | + text: Subprocess launch(ed with variable|ing should be audited) |
| 84 | + - path: (.+)\.go$ |
| 85 | + text: (G104|G307) |
| 86 | + - path: (.+)\.go$ |
| 87 | + text: at least one file in a package should have a package comment |
| 88 | + paths: |
| 89 | + - third_party$ |
| 90 | + - builtin$ |
| 91 | + - examples$ |
45 | 92 | issues: |
46 | | - exclude-use-default: false |
47 | | - exclude: |
48 | | - # EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok |
49 | | - - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
50 | | - |
51 | | - # EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments |
52 | | - # - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) |
53 | | - |
54 | | - # EXC0003 golint: False positive when tests are defined in package 'test' |
55 | | - - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this |
56 | | - |
57 | | - # EXC0004 govet: Common false positives |
58 | | - - (possible misuse of unsafe.Pointer|should have signature) |
59 | | - |
60 | | - # EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore |
61 | | - # - ineffective break statement. Did you mean to break out of the outer loop |
62 | | - |
63 | | - # EXC0006 gosec: Too many false-positives on 'unsafe' usage |
64 | | - - Use of unsafe calls should be audited |
65 | | - |
66 | | - # EXC0007 gosec: Too many false-positives for parametrized shell calls |
67 | | - - Subprocess launch(ed with variable|ing should be audited) |
68 | | - |
69 | | - # EXC0008 gosec: Duplicated errcheck checks |
70 | | - - (G104|G307) |
71 | | - |
72 | | - # EXC0009 gosec: Too many issues in popular repos |
73 | | - # - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) |
74 | | - # EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' |
75 | | - # - Potential file inclusion via variable |
76 | | - # EXC0011 stylecheck: Annoying issue about not having a comment. The rare codebase has such comments |
77 | | - # - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) |
78 | | - |
79 | | - - at least one file in a package should have a package comment |
80 | | - |
81 | | - exclude-rules: |
82 | | - - path: test |
83 | | - linters: |
84 | | - - gocyclo |
85 | | - - gochecknoglobals |
86 | | - - wrapcheck |
87 | | - - nlreturn |
88 | | - - errcheck |
89 | | - - path: cmd/manager/main.go |
90 | | - linters: |
91 | | - - gochecknoglobals |
92 | | - - wrapcheck |
93 | | - - path: test/e2e |
94 | | - linters: |
95 | | - - stylecheck |
96 | | - - noctx |
97 | | - - path: test/helper |
98 | | - linters: |
99 | | - - stylecheck |
100 | | - text: "ST1000:|ST1001:|ST1003:" |
101 | | - - path: test/helper/e2e/appclient |
102 | | - linters: |
103 | | - - noctx |
104 | | - - path: pkg/controller |
105 | | - linters: |
106 | | - - prealloc |
107 | | - - dupl |
108 | | - - unparam |
109 | | - - path: pkg/controller/atlasdatabaseuser/connectionsecrets |
110 | | - linters: |
111 | | - - prealloc |
112 | | - - path: pkg/util/testutil/ |
113 | | - linters: |
114 | | - - stylecheck |
115 | 93 | max-issues-per-linter: 0 |
116 | 94 | max-same-issues: 0 |
| 95 | +formatters: |
| 96 | + enable: |
| 97 | + - gofmt |
| 98 | + - goimports |
| 99 | + settings: |
| 100 | + goimports: |
| 101 | + local-prefixes: |
| 102 | + - github.com/mongodb/mongodb-atlas-kubernetes/v2 |
| 103 | + exclusions: |
| 104 | + generated: lax |
| 105 | + paths: |
| 106 | + - third_party$ |
| 107 | + - builtin$ |
| 108 | + - examples$ |
0 commit comments