Skip to content

Commit 4beaff3

Browse files
committed
chore: update golangci
1 parent ee2be98 commit 4beaff3

File tree

2 files changed

+83
-73
lines changed

2 files changed

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

0 commit comments

Comments
 (0)