|
| 1 | +version: "2" |
1 | 2 | run:
|
2 | 3 | go: "1.24"
|
3 | 4 | timeout: 5m
|
4 | 5 |
|
5 | 6 | linters:
|
6 |
| - enable-all: true |
| 7 | + default: all |
7 | 8 | disable:
|
8 |
| - # Base linters disabled for all projects. |
9 |
| - - funlen |
10 |
| - - mnd # Same as above |
| 9 | + - contextcheck # Requires to change a lot of code to pass a context everywhere. |
| 10 | + - cyclop # We use maintidx to lint function complexity. |
| 11 | + - errorlint # Should be enabled, but it's difficult to test that we keep the same behavior with errors.As. |
11 | 12 | - exhaustruct # This linter is meant to be used only for special cases. It is not recommended to use it for all files in a project.
|
12 |
| - - gci # Conflicts with gofumpt. |
13 |
| - - ireturn # Complain that interface A implementation method return an interface B... it's a requirement of interface A that is unavoidable. |
14 |
| - - nonamedreturns # Warn for every named return, not useful. |
| 13 | + - funlen |
| 14 | + - gocognit # We use maintidx to lint function complexity. |
| 15 | + - gocyclo # We use maintidx to lint function complexity. |
| 16 | + - godox # Too many TODO in code, but should be removed and TODO fixed :) |
| 17 | + - gomoddirectives # We sometimes need to use mod replacements to fix upgrades. |
15 | 18 | - interfacebloat # Warn when an interface has too many methods, not useful.
|
16 |
| - # Deprecated and replaced linter. |
17 |
| - - tenv |
18 |
| - # We use maintidx to lint function complexity. |
19 |
| - - gocyclo |
20 |
| - - cyclop |
21 |
| - - gocognit |
22 |
| - |
23 |
| - # Project specific disable. |
| 19 | + - ireturn # Complain that interface A implementation method return an interface B... it's a requirement of interface A that is unavoidable. |
24 | 20 | - lll
|
25 |
| - - varnamelen # I think there is too many false-positive. |
26 |
| - - godox # too many TODO in code, but should be removed and TODO fixed :) |
| 21 | + - mnd # Too picky. |
| 22 | + - musttag # json tags must be added public fields used in JSON. Disabled because it also reports errors on dependencies. |
27 | 23 | - nestif # Too many error for now, which would require significant refactor.
|
| 24 | + - nonamedreturns # Warn for every named return, not useful. |
| 25 | + - paralleltest # Requires reviewing all our tests. Should be done. |
28 | 26 | - tagliatelle # Check struct tags. Too many errors we can't fix.
|
| 27 | + - testpackage # Requires reviewing all our tests. Should be done. |
| 28 | + - tparallel # Requires reviewing all our tests. Should be done. |
| 29 | + - varnamelen # I think there is too many false-positive. |
29 | 30 | - wrapcheck # Too many errors, which would require to refactor most returned errors.
|
30 |
| - - errorlint # Should be enabled, but it's difficult to test that we keep the same behavior with errors.As. |
31 |
| - - contextcheck # Requires to change a lot of code to pass a context everywhere. |
32 |
| - - gomoddirectives # We sometimes need to use mod replacements to fix upgrades. |
33 |
| - - musttag # json tags must be added public fields used in JSON. Disabled because it also report errors on dependencies. |
34 |
| - # Requires to review all our tests. Should be done. |
35 |
| - - paralleltest |
36 |
| - - tparallel |
37 |
| - - testpackage |
38 | 31 |
|
39 |
| -linters-settings: |
40 |
| - nolintlint: |
41 |
| - # Require nolint directives to mention the specific linter being suppressed. |
42 |
| - require-specific: true |
43 |
| - |
44 |
| - tagliatelle: |
45 |
| - # Check struct tag name case. |
46 |
| - case: |
47 |
| - # Use the struct field name to check the name of the struct tag. |
| 32 | + settings: |
| 33 | + depguard: |
| 34 | + rules: |
| 35 | + main: |
| 36 | + deny: |
| 37 | + - pkg: io/ioutil |
| 38 | + desc: ioutil is deprecated starting with Go 1.16 |
| 39 | + nolintlint: |
| 40 | + # Require nolint directives to mention the specific linter being suppressed. |
| 41 | + require-specific: true |
| 42 | + revive: |
48 | 43 | rules:
|
49 |
| - json: snake |
50 |
| - yaml: snake |
| 44 | + - name: exported |
| 45 | + disabled: true |
| 46 | + staticcheck: |
| 47 | + checks: |
| 48 | + - "all" |
| 49 | + - "-QF1008" # Omit embedded fields from selector expression |
| 50 | + - "-ST1000" # Incorrect or missing package comment |
| 51 | + tagliatelle: |
| 52 | + # Check struct tag name case. |
| 53 | + case: |
| 54 | + # Use the struct field name to check the name of the struct tag. |
| 55 | + rules: |
| 56 | + json: snake |
| 57 | + yaml: snake |
51 | 58 |
|
52 |
| - depguard: |
53 |
| - rules: |
54 |
| - main: |
55 |
| - deny: |
56 |
| - - pkg: "io/ioutil" |
57 |
| - desc: "ioutil is deprecated starting with Go 1.16" |
| 59 | + exclusions: |
| 60 | + generated: lax |
| 61 | + presets: |
| 62 | + - common-false-positives |
| 63 | + - std-error-handling |
| 64 | + paths: |
| 65 | + - work |
| 66 | + - third_party$ |
| 67 | + - builtin$ |
| 68 | + - examples$ |
58 | 69 |
|
59 | 70 | issues:
|
60 |
| - include: # the list of ids of default excludes to include |
61 |
| - - EXC0005 # ineffective break statement |
62 |
| - - EXC0009 # create files/directories with minimum permissions |
63 |
| - # - EXC0011 # TODO: should have a package comment|comment should be of the form |
64 |
| - # - EXC0012 # TODO: exported var/functions should have a comment |
65 |
| - - EXC0013 # package comment should be of the form |
66 |
| - - EXC0014 # comment on exported var should be of the form |
67 |
| - |
68 | 71 | max-issues-per-linter: 0
|
69 | 72 | max-same-issues: 0
|
70 |
| - exclude-dirs: |
71 |
| - - work |
| 73 | + |
| 74 | +formatters: |
| 75 | + enable: |
| 76 | + - gofmt |
| 77 | + - gofumpt |
| 78 | + - goimports |
| 79 | + |
| 80 | + exclusions: |
| 81 | + generated: lax |
| 82 | + paths: |
| 83 | + - work |
| 84 | + - third_party$ |
| 85 | + - builtin$ |
| 86 | + - examples$ |
0 commit comments