|
1 |
| -linters: |
2 |
| - # Disable all linters. |
3 |
| - disable-all: true |
4 |
| - # Enable specific linter |
5 |
| - enable: |
6 |
| - - sloglint |
7 |
| - - errcheck |
8 |
| - - gci |
9 |
| - - wrapcheck |
10 |
| - |
| 1 | +version: "2" |
11 | 2 | run:
|
12 |
| - # Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously. |
13 |
| - # If it is explicitly set to 0 (i.e. not the default) then golangci-lint will automatically set the value to match Linux container CPU quota. |
14 |
| - # Default: the number of logical CPUs in the machine |
15 | 3 | concurrency: 8
|
16 |
| - # Timeout for analysis, e.g. 30s, 5m. |
17 |
| - # Default: 1m |
18 |
| - timeout: 5m |
19 |
| - go: '1.22.0' |
20 |
| - |
| 4 | + go: 1.22.0 |
21 | 5 | output:
|
22 |
| - # Show statistics per linter. |
23 |
| - show-stats: true |
24 |
| - # Sort results by the order defined in `sort-order`. |
25 |
| - sort-results: true |
26 |
| - # Order to use when sorting results. |
27 |
| - # Require `sort-results` to `true`. |
28 |
| - # Possible values: `file`, `linter`, and `severity`. |
29 |
| - # |
30 |
| - # If the severity values are inside the following list, they are ordered in this order: |
31 |
| - # 1. error |
32 |
| - # 2. warning |
33 |
| - # 3. high |
34 |
| - # 4. medium |
35 |
| - # 5. low |
36 |
| - # Either they are sorted alphabetically. |
37 | 6 | sort-order:
|
38 | 7 | - linter
|
39 | 8 | - file
|
40 | 9 | - severity
|
41 |
| - |
| 10 | +linters: |
| 11 | + default: none |
| 12 | + enable: |
| 13 | + - errcheck |
| 14 | + - sloglint |
| 15 | + - wrapcheck |
| 16 | + settings: |
| 17 | + errcheck: |
| 18 | + exclude-functions: |
| 19 | + - (net/http.ResponseWriter).Write |
| 20 | + sloglint: |
| 21 | + attr-only: true |
| 22 | + exclusions: |
| 23 | + generated: lax |
| 24 | + presets: |
| 25 | + - comments |
| 26 | + - common-false-positives |
| 27 | + - legacy |
| 28 | + - std-error-handling |
| 29 | + rules: |
| 30 | + - linters: |
| 31 | + - lll |
| 32 | + source: '^//go:generate ' |
| 33 | + paths: |
| 34 | + - .*\.gen\.go$ |
| 35 | + - .*\.ridl$ |
| 36 | + - vendor |
| 37 | + - tools |
| 38 | + - scripts |
| 39 | + - bin |
| 40 | + - .buildkite |
| 41 | + - etc |
| 42 | + - third_party$ |
| 43 | + - builtin$ |
| 44 | + - examples$ |
42 | 45 | issues:
|
43 |
| - # Maximum issues count per one linter. |
44 |
| - # Set to 0 to disable. |
45 |
| - # Default: 50 |
46 | 46 | max-issues-per-linter: 0
|
47 |
| - # Maximum count of issues with the same text. |
48 |
| - # Set to 0 to disable. |
49 |
| - # Default: 3 |
50 | 47 | max-same-issues: 0
|
51 |
| - exclude-rules: |
52 |
| - - linters: |
53 |
| - - lll |
54 |
| - source: "^//go:generate " |
55 |
| - exclude-dirs: |
56 |
| - - "vendor" |
57 |
| - - "tools" |
58 |
| - - "scripts" |
59 |
| - - "bin" |
60 |
| - - ".buildkite" |
61 |
| - - "etc" |
62 |
| - exclude-files: |
63 |
| - - ".*\\.gen\\.go$" |
64 |
| - - ".*\\.ridl$" |
65 |
| - |
66 |
| -linters-settings: |
67 |
| - sloglint: |
68 |
| - # Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only). |
69 |
| - # https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only |
70 |
| - attr-only: true |
71 |
| - errcheck: |
72 |
| - # List of functions to exclude from checking, where each entry is a single function to exclude. |
73 |
| - # See https://github.com/kisielk/errcheck#excluding-functions for details. |
74 |
| - exclude-functions: |
75 |
| - - (net/http.ResponseWriter).Write |
76 |
| - |
77 |
| - gci: |
78 |
| - # Section configuration to compare against. |
79 |
| - # Section names are case-insensitive and may contain parameters in (). |
80 |
| - # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`, |
81 |
| - # If `custom-order` is `true`, it follows the order of `sections` option. |
82 |
| - # Default: ["standard", "default"] |
83 |
| - sections: |
84 |
| - - standard # Standard section: captures all standard packages. |
85 |
| - - default # Default section: contains all imports that could not be matched to another section type. |
86 |
| - - prefix(github.com/0xsequence/go-libs) # Custom section: groups all imports with the specified Prefix. |
87 |
| - # Skip generated files. |
88 |
| - # Default: true |
89 |
| - skip-generated: true |
90 |
| - # Enable custom order of sections. |
91 |
| - # If `true`, make the section order the same as the order of `sections`. |
92 |
| - # Default: false |
93 |
| - custom-order: true |
94 |
| - # Drops lexical ordering for custom sections. |
95 |
| - # Default: false |
96 |
| - no-lex-order: false |
| 48 | +formatters: |
| 49 | + enable: |
| 50 | + - gci |
| 51 | + settings: |
| 52 | + gci: |
| 53 | + sections: |
| 54 | + - standard |
| 55 | + - default |
| 56 | + - prefix(github.com/0xsequence/go-libs) |
| 57 | + custom-order: true |
| 58 | + no-lex-order: false |
| 59 | + exclusions: |
| 60 | + generated: lax |
| 61 | + paths: |
| 62 | + - .*\.gen\.go$ |
| 63 | + - .*\.ridl$ |
| 64 | + - vendor |
| 65 | + - tools |
| 66 | + - scripts |
| 67 | + - bin |
| 68 | + - .buildkite |
| 69 | + - etc |
| 70 | + - third_party$ |
| 71 | + - builtin$ |
| 72 | + - examples$ |
0 commit comments