|
1 | | -issues: |
2 | | - # List of regexps of issue texts to exclude, empty list by default. |
3 | | - # But independently from this option we use default exclude patterns, |
4 | | - # it can be disabled by `exclude-use-default: false`. To list all |
5 | | - # excluded by default patterns execute `golangci-lint run --help` |
6 | | - |
7 | | - exclude-rules: |
8 | | - # Exclude gosimple bool check |
9 | | - - linters: |
10 | | - - gosimple |
11 | | - text: "S(1002|1008|1021)" |
12 | | - # Exclude failing staticchecks for now |
13 | | - - linters: |
14 | | - - staticcheck |
15 | | - text: "SA(1006|1019|4006|4010|4017|5007|6005|9004):" |
16 | | - # Exclude lll issues for long lines with go:generate |
17 | | - - linters: |
18 | | - - lll |
19 | | - source: "^//go:generate " |
20 | | - |
21 | | - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
22 | | - max-issues-per-linter: 0 |
23 | | - |
24 | | - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
25 | | - max-same-issues: 0 |
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + issues-exit-code: 1 |
| 4 | + tests: true |
26 | 5 |
|
27 | 6 | linters: |
28 | | - disable-all: true |
29 | 7 | enable: |
30 | | - # - gofumpt |
31 | | - # - goimports |
32 | | - - gosimple |
33 | 8 | - govet |
34 | 9 | - ineffassign |
35 | 10 | - staticcheck |
36 | 11 | - unconvert |
37 | 12 | - unused |
38 | | - fast: true |
39 | | - |
40 | | -# options for analysis running |
41 | | -run: |
42 | | - go: "1.19" |
43 | | - |
44 | | - # default concurrency is a available CPU number |
45 | | - concurrency: 4 |
46 | | - |
47 | | - # timeout for analysis, e.g. 30s, 5m, default is 1m |
48 | | - timeout: 10m |
49 | | - |
50 | | - # exit code when at least one issue was found, default is 1 |
51 | | - issues-exit-code: 1 |
52 | | - |
53 | | - # include test files or not, default is true |
54 | | - tests: true |
55 | | - |
56 | | - # list of build tags, all linters use it. Default is empty list. |
57 | | - #build-tags: |
58 | | - # - mytag |
59 | | - |
60 | | - # which dirs to skip: issues from them won't be reported; |
61 | | - # can use regexp here: generated.*, regexp is applied on full path; |
62 | | - # default value is empty list, but default dirs are skipped independently |
63 | | - # from this option's value (see skip-dirs-use-default). |
64 | | - #skip-dirs: |
65 | | - # - src/external_libs |
66 | | - # - autogenerated_by_my_lib |
67 | | - |
68 | | - # default is true. Enables skipping of directories: |
69 | | - # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
70 | | - skip-dirs-use-default: true |
71 | | - |
72 | | - # which files to skip: they will be analyzed, but issues from them |
73 | | - # won't be reported. Default value is empty list, but there is |
74 | | - # no need to include all autogenerated files, we confidently recognize |
75 | | - # autogenerated files. If it's not please let us know. |
76 | | - skip-files: |
77 | | - - ".*\\.hcl2spec\\.go$" |
78 | | - - "docstrings/gen.go" |
79 | | - # - lib/bad.go |
80 | | - |
81 | | - # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": |
82 | | - # If invoked with -mod=readonly, the go command is disallowed from the implicit |
83 | | - # automatic updating of go.mod described above. Instead, it fails when any changes |
84 | | - # to go.mod are needed. This setting is most useful to check that go.mod does |
85 | | - # not need updates, such as in a continuous integration and testing system. |
86 | | - # If invoked with -mod=vendor, the go command assumes that the vendor |
87 | | - # directory holds the correct copies of dependencies and ignores |
88 | | - # the dependency descriptions in go.mod. |
89 | | - # modules-download-mode: vendor |
90 | | - |
91 | | -# output configuration options |
92 | | -output: |
93 | | - # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" |
94 | | - format: colored-line-number |
95 | | - |
96 | | - # print lines of code with issue, default is true |
97 | | - print-issued-lines: true |
98 | | - |
99 | | - # print linter name in the end of issue text, default is true |
100 | | - print-linter-name: true |
101 | | - |
102 | | - # make issues output unique by line, default is true |
103 | | - uniq-by-line: true |
104 | | - |
105 | | -# all available settings of specific linters |
106 | | -linters-settings: |
107 | | - gofumpt: |
108 | | - module-path: github.com/fly-apps/postgres-flex |
109 | | - errcheck: |
110 | | - # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
111 | | - # default is false: such cases aren't reported by default. |
112 | | - check-type-assertions: false |
113 | | - |
114 | | - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
115 | | - # default is false: such cases aren't reported by default. |
116 | | - check-blank: false |
117 | | - |
118 | | - # [deprecated] comma-separated list of pairs of the form pkg:regex |
119 | | - # the regex is used to ignore names within pkg. (default "fmt:.*"). |
120 | | - # see https://github.com/kisielk/errcheck#the-deprecated-method for details |
121 | | - ignore: fmt:.*,io/ioutil:^Read.*,io:Close |
122 | | - |
123 | | - # path to a file containing a list of functions to exclude from checking |
124 | | - # see https://github.com/kisielk/errcheck#excluding-functions for details |
125 | | - #exclude: /path/to/file.txt |
| 13 | + - nlreturn |
| 14 | + - bodyclose |
| 15 | + - gocheckcompilerdirectives |
| 16 | + - errname |
| 17 | + - errchkjson |
| 18 | + settings: |
| 19 | + nlreturn: |
| 20 | + block-size: 3 |
| 21 | + |
| 22 | + staticcheck: |
| 23 | + checks: |
| 24 | + - all |
| 25 | + - -ST1003 # struct field ... should be ... (mostly acronyms such as Http -> HTTP) |
| 26 | + |
| 27 | +formatters: |
| 28 | + enable: |
| 29 | + - gofumpt |
0 commit comments