Skip to content

Commit 058964f

Browse files
committed
chore: update golangci
1 parent 7aff08d commit 058964f

File tree

2 files changed

+88
-77
lines changed

2 files changed

+88
-77
lines changed

.github/workflows/linters.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ jobs:
1616
go-version: stable
1717

1818
- name: Run linter
19-
uses: golangci/golangci-lint-action@v6.5.2 # Action page: <https://github.com/golangci/golangci-lint-action>
19+
uses: golangci/golangci-lint-action@v7 # Action page: <https://github.com/golangci/golangci-lint-action>
2020
with:
21-
version: v1.64 # without patch version
2221
only-new-issues: false # show only new issues if it's a pull request
2322
args: --timeout=10m --build-tags=race

.golangci.yml

Lines changed: 87 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,93 @@
1-
# Documentation: <https://github.com/golangci/golangci-lint#config-file>
2-
1+
version: "2"
32
run:
4-
timeout: 1m
53
modules-download-mode: readonly
64
allow-parallel-runners: true
7-
85
output:
96
formats:
10-
- format: colored-line-number
11-
12-
linters-settings:
13-
revive:
14-
confidence: 0.8
15-
godot:
16-
scope: declarations
17-
capital: true
18-
dupl:
19-
threshold: 100
20-
goconst:
21-
min-len: 2
22-
min-occurrences: 3
23-
misspell:
24-
locale: US
25-
lll:
26-
line-length: 120
27-
prealloc:
28-
simple: true
29-
range-loops: true
30-
for-loops: true
31-
nolintlint:
32-
require-specific: true
33-
34-
linters: # All available linters list: <https://golangci-lint.run/usage/linters/>
35-
disable-all: true
7+
text:
8+
path: stdout
9+
linters:
10+
default: none
3611
enable:
37-
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
38-
- bodyclose # Checks whether HTTP response body is closed successfully
39-
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
40-
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
41-
- exhaustive # check exhaustiveness of enum switch statements
42-
- copyloopvar # Checks for using loop variables in function literal closures
43-
- gochecknoinits # Checks that no init functions are present in Go code
44-
- goconst # Finds repeated strings that could be replaced by a constant
45-
- gocritic # The most opinionated Go source code linter
46-
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
47-
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
48-
- revive # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
49-
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
50-
- gosec # Inspects source code for security problems
51-
- gosimple # Linter for Go source code that specializes in simplifying a code
52-
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
53-
- ineffassign # Detects when assignments to existing variables are not used
54-
- misspell # Finds commonly misspelled English words in comments
55-
- nakedret # Finds naked returns in functions greater than a specified function length
56-
- noctx # finds sending http request without context.Context
57-
- nolintlint # Reports ill-formed or insufficient nolint directives
58-
- prealloc # Finds slice declarations that could potentially be preallocated
59-
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
60-
- stylecheck # Stylecheck is a replacement for golint
61-
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
62-
- unconvert # Remove unnecessary type conversions
63-
- unused # Checks Go code for unused constants, variables, functions and types
64-
- whitespace # Tool for detection of leading and trailing whitespace
65-
66-
issues:
67-
exclude-dirs:
68-
- .github
69-
- .git
70-
exclude-rules:
71-
- path: _test\.go
72-
linters:
73-
- dupl
74-
- funlen
75-
- scopelint
76-
- gocognit
77-
- goconst
78-
- noctx
79-
- gosimple
80-
- revive
81-
- gochecknoinits
12+
- asciicheck
13+
- bodyclose
14+
- copyloopvar
15+
- dogsled
16+
- errcheck
17+
- exhaustive
18+
- gochecknoinits
19+
- goconst
20+
- gocritic
21+
- goprintffuncname
22+
- gosec
23+
- govet
24+
- ineffassign
25+
- misspell
26+
- nakedret
27+
- noctx
28+
- nolintlint
29+
- prealloc
30+
- revive
31+
- staticcheck
32+
- tparallel
33+
- unconvert
34+
- unused
35+
- whitespace
36+
settings:
37+
dupl:
38+
threshold: 100
39+
goconst:
40+
min-len: 2
41+
min-occurrences: 3
42+
godot:
43+
scope: declarations
44+
capital: true
45+
lll:
46+
line-length: 120
47+
misspell:
48+
locale: US
49+
nolintlint:
50+
require-specific: true
51+
prealloc:
52+
simple: true
53+
range-loops: true
54+
for-loops: true
55+
revive:
56+
confidence: 0.8
57+
exclusions:
58+
generated: lax
59+
presets:
60+
- comments
61+
- common-false-positives
62+
- legacy
63+
- std-error-handling
64+
rules:
65+
- linters:
66+
- dupl
67+
- funlen
68+
- gochecknoinits
69+
- gocognit
70+
- goconst
71+
- noctx
72+
- revive
73+
- scopelint
74+
- staticcheck
75+
path: _test\.go
76+
paths:
77+
- .github
78+
- .git
79+
- third_party$
80+
- builtin$
81+
- examples$
82+
formatters:
83+
enable:
84+
- gofmt
85+
- goimports
86+
exclusions:
87+
generated: lax
88+
paths:
89+
- .github
90+
- .git
91+
- third_party$
92+
- builtin$
93+
- examples$

0 commit comments

Comments
 (0)