Skip to content

Commit 0dc6570

Browse files
authored
Merge branch 'master' into forbidigo-update
2 parents be241f8 + bc616e8 commit 0dc6570

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+627
-512
lines changed

.github/workflows/post-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: make update_netlify_state
3838

3939
- name: Create Pull Request
40-
uses: peter-evans/create-pull-request@v4
40+
uses: peter-evans/create-pull-request@v5
4141
with:
4242
base: master
4343
token: ${{ secrets.GOLANGCI_LINT_TOKEN }}

.golangci.reference.yml

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -171,49 +171,38 @@ linters-settings:
171171
disable-dec-num-check: false
172172

173173
depguard:
174-
# Kind of list is passed in.
175-
# Allowed values: allowlist|denylist
176-
# Default: denylist
177-
list-type: allowlist
178-
179-
# Check the list against standard lib.
180-
# Default: false
181-
include-go-root: true
182-
183-
# A list of packages for the list type specified.
184-
# Can accept both string prefixes and string glob patterns.
185-
# Default: []
186-
packages:
187-
- github.com/sirupsen/logrus
188-
- allow/**/pkg
189-
190-
# A list of packages for the list type specified.
191-
# Specify an error message to output when a denied package is used.
192-
# Default: []
193-
packages-with-error-message:
194-
- github.com/sirupsen/logrus: 'logging is allowed only by logutils.Log'
195-
196-
# Specify rules by which the linter ignores certain files for consideration.
197-
# Can accept both string prefixes and string glob patterns.
198-
# The ! character in front of the rule is a special character
199-
# which signals that the linter should negate the rule.
200-
# This allows for more precise control, but it is only available for glob patterns.
201-
# Default: []
202-
ignore-file-rules:
203-
- "ignore/**/*.go"
204-
- "!**/*_test.go"
205-
206-
# Create additional guards that follow the same configuration pattern.
207-
# Results from all guards are aggregated together.
208-
additional-guards:
209-
- list-type: denylist
210-
include-go-root: false
211-
packages:
212-
- github.com/stretchr/testify
213-
# Specify rules by which the linter ignores certain files for consideration.
214-
ignore-file-rules:
215-
- "**/*_test.go"
216-
- "**/mock/**/*.go"
174+
# Rules to apply.
175+
#
176+
# Variables:
177+
# - File Variables
178+
# you can still use and exclamation mark ! in front of a variable to say not to use it.
179+
# Example !$test will match any file that is not a go test file.
180+
#
181+
# `$all` - matches all go files
182+
# `$test` - matches all go test files
183+
#
184+
# - Package Variables
185+
#
186+
# `$gostd` - matches all of go's standard library (Pulled from `GOROOT`)
187+
#
188+
# Default: no rules.
189+
rules:
190+
# Name of a rule.
191+
main:
192+
# List of file globs that will match this list of settings to compare against.
193+
# Default: $all
194+
files:
195+
- "!**/*_a _file.go"
196+
# List of allowed packages.
197+
allow:
198+
- $gostd
199+
- github.com/OpenPeeDeeP
200+
# Packages that are not allowed where the value is a suggestion.
201+
deny:
202+
- pkg: "github.com/sirupsen/logrus"
203+
desc: not allowed
204+
- pkg: "github.com/pkg/errors"
205+
desc: Should be replaced by standard lib errors package
217206

218207
dogsled:
219208
# Checks assignments with too many blank identifiers.
@@ -730,15 +719,15 @@ linters-settings:
730719
# Values always ignored: `.+_test.go`
731720
# Default: []
732721
ignored-files:
733-
- 'magic1_.*.go'
722+
- 'magic1_.+\.go$'
734723
# List of function patterns to exclude from analysis.
735724
# Following functions are always ignored: `time.Date`,
736725
# `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
737726
# `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
738727
# Default: []
739728
ignored-functions:
740-
- 'math.*'
741-
- 'http.StatusText'
729+
- '^math\.'
730+
- '^http\.StatusText$'
742731

743732
gomoddirectives:
744733
# Allow local `replace` directives.
@@ -1187,13 +1176,14 @@ linters-settings:
11871176
max: 5
11881177

11891178
ireturn:
1190-
# ireturn allows using `allow` and `reject` settings at the same time.
1179+
# ireturn does not allow using `allow` and `reject` settings at the same time.
11911180
# Both settings are lists of the keywords and regular expressions matched to interface or package names.
11921181
# keywords:
11931182
# - `empty` for `interface{}`
11941183
# - `error` for errors
11951184
# - `stdlib` for standard library
11961185
# - `anon` for anonymous interfaces
1186+
# - `generic` for generic interfaces added in go 1.18
11971187

11981188
# By default, it allows using errors, empty interfaces, anonymous interfaces,
11991189
# and interfaces provided by the standard library.
@@ -2190,6 +2180,7 @@ linters:
21902180
- whitespace
21912181
- wrapcheck
21922182
- wsl
2183+
- zerologlint
21932184

21942185
# Enable all available linters.
21952186
# Default: false
@@ -2302,6 +2293,7 @@ linters:
23022293
- whitespace
23032294
- wrapcheck
23042295
- wsl
2296+
- zerologlint
23052297

23062298
# Enable presets.
23072299
# https://golangci-lint.run/usage/linters

.golangci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
linters-settings:
22
depguard:
3+
# old configuration. TODO(ldez): must be removed
34
list-type: denylist
45
packages:
56
# logging is allowed only by logutils.Log, logrus
67
# is allowed to use only in logutils package
78
- github.com/sirupsen/logrus
89
packages-with-error-message:
910
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
11+
# new configuration
12+
rules:
13+
logger:
14+
deny:
15+
# logging is allowed only by logutils.Log,
16+
# logrus is allowed to use only in logutils package.
17+
- pkg: "github.com/sirupsen/logrus"
18+
desc: logging is allowed only by logutils.Log
1019
dupl:
1120
threshold: 100
1221
funlen:
@@ -29,6 +38,10 @@ linters-settings:
2938
- whyNoLint
3039
gocyclo:
3140
min-complexity: 15
41+
gofmt:
42+
rewrite-rules:
43+
- pattern: 'interface{}'
44+
replacement: 'any'
3245
goimports:
3346
local-prefixes: github.com/golangci/golangci-lint
3447
gomnd:
@@ -67,6 +80,7 @@ linters-settings:
6780
rules:
6881
- name: unexported-return
6982
disabled: true
83+
- name: unused-parameter
7084

7185
linters:
7286
disable-all: true

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ There is the most valuable changes log:
8787

8888
1. new linters
8989
* `ginkgolinter`: https://github.com/nunnatsa/ginkgolinter
90-
* `musttag`: https://github.com/junk1tm/musttag
90+
* `musttag`: https://github.com/tmzane/musttag
9191
* `gocheckcompilerdirectives`: https://github.com/leighmcculloch/gocheckcompilerdirectives
9292
2. updated linters
9393
* `bodyclose`: to HEAD

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ The Core Team has the following responsibilities:
181181
<td align="center"><a href="https://github.com/barthr?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/9822478?u=c159fa0a22133fabb6a8468ed2372273f60cc7d9&v=4" width="100px;" alt=""/><br /><sub><b>Bart</b></sub></a></td>
182182
<td align="center"><a href="https://github.com/neha-viswanathan?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/12013126?u=479684c936cc8b80f122fdede3f4afc4ceb80136&v=4" width="100px;" alt=""/><br /><sub><b>Neha Viswanathan</b></sub></a></td>
183183
<td align="center"><a href="https://github.com/dbraley?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/2067019?u=47d3d161a65b877714779c39d2eb6dc686d427ec&v=4" width="100px;" alt=""/><br /><sub><b>David Braley</b></sub></a></td>
184-
<td align="center"><a href="https://github.com/junk1tm?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/73077675?u=2e0a95650ef31e86c4b40b8d041794f6752aed3a&v=4" width="100px;" alt=""/><br /><sub><b>Tom</b></sub></a></td>
184+
<td align="center"><a href="https://github.com/tmzane?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/73077675?u=2e0a95650ef31e86c4b40b8d041794f6752aed3a&v=4" width="100px;" alt=""/><br /><sub><b>Tom</b></sub></a></td>
185185
<td align="center"><a href="https://github.com/cbandy?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/106560?v=4" width="100px;" alt=""/><br /><sub><b>Chris Bandy</b></sub></a></td>
186186
<td align="center"><a href="https://patrickkuca.com?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/9790383?u=f3ee6bab4997260734040e0119d4cb35810973d7&v=4" width="100px;" alt=""/><br /><sub><b>Patrick Kuca</b></sub></a></td>
187187
<td align="center"><a href="https://dev.to/vearutop?utm_source=golangci-lint-contributors"><img src="https://avatars.githubusercontent.com/u/1381436?v=4" width="100px;" alt=""/><br /><sub><b>Viacheslav Poturaev</b></sub></a></td>

docs/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"gatsby-plugin-react-helmet": "^5.21.0",
2323
"gatsby-plugin-react-svg": "^3.1.0",
2424
"gatsby-plugin-robots-txt": "^1.7.1",
25-
"gatsby-plugin-sharp": "^4.25.0",
25+
"gatsby-plugin-sharp": "^4.25.1",
2626
"gatsby-plugin-sitemap": "^5.24.0",
2727
"gatsby-remark-autolink-headers": "^5.24.0",
2828
"gatsby-remark-copy-linked-files": "^5.24.0",

docs/src/docs/contributing/new-linters.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ from scratch and integrate it into `golangci-lint`.
1010
## How to add a public linter to `golangci-lint`
1111

1212
You need to implement a new linter using `go/analysis` API.
13-
We don't accept not `go/analysis` linters.
13+
We don't accept non `go/analysis` linters.
1414

1515
After that:
1616

docs/src/docs/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Follow the news and releases on our twitter <IconContainer color="#1DA1F2"><FaTw
2121
## Features
2222

2323
-[Very fast](/usage/performance): runs linters in parallel, reuses Go build cache and caches analysis results.
24-
- ⚙️ Yaml-based [configuration](/usage/configuration).
25-
- 🖥 [integrations](/usage/integrations) with VS Code, Sublime Text, GoLand, GNU Emacs, Vim, Atom, GitHub Actions.
24+
- ⚙️ YAML-based [configuration](/usage/configuration).
25+
- 🖥 [Integrations](/usage/integrations) with VS Code, Sublime Text, GoLand, GNU Emacs, Vim, Atom, GitHub Actions.
2626
- 🥇 [A lot of linters](/usage/linters) included, no need to install them.
2727
- 📈 Minimum number of [false positives](/usage/false-positives) because of tuned default settings.
28-
- 🔥nice output with colors, source code lines and marked `identifiers`.
28+
- 🔥 Nice output with colors, source code lines and marked `identifiers`.
2929

3030
[Get started now!](/usage/install)
3131

go.mod

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ require (
1212
github.com/BurntSushi/toml v1.2.1
1313
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24
1414
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0
15-
github.com/OpenPeeDeeP/depguard v1.1.1
15+
github.com/OpenPeeDeeP/depguard/v2 v2.0.1
16+
github.com/alexkohler/nakedret/v2 v2.0.1
1617
github.com/alexkohler/prealloc v1.0.0
1718
github.com/alingse/asasalint v0.0.11
1819
github.com/ashanbrown/forbidigo v1.5.1
@@ -22,7 +23,7 @@ require (
2223
github.com/bombsimon/wsl/v3 v3.4.0
2324
github.com/breml/bidichk v0.2.4
2425
github.com/breml/errchkjson v0.3.1
25-
github.com/butuzov/ireturn v0.1.1
26+
github.com/butuzov/ireturn v0.2.0
2627
github.com/charithe/durationcheck v0.0.10
2728
github.com/curioswitch/go-reassign v0.2.0
2829
github.com/daixiang0/gci v0.10.1
@@ -31,7 +32,7 @@ require (
3132
github.com/fatih/color v1.15.0
3233
github.com/firefart/nonamedreturns v1.0.4
3334
github.com/fzipp/gocyclo v0.6.0
34-
github.com/go-critic/go-critic v0.7.0
35+
github.com/go-critic/go-critic v0.8.0
3536
github.com/go-xmlfmt/xmlfmt v1.1.2
3637
github.com/gofrs/flock v0.8.1
3738
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
@@ -53,14 +54,13 @@ require (
5354
github.com/jingyugao/rowserrcheck v1.1.1
5455
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af
5556
github.com/julz/importas v0.1.0
56-
github.com/junk1tm/musttag v0.5.0
5757
github.com/kisielk/errcheck v1.6.3
5858
github.com/kkHAIKE/contextcheck v1.1.4
5959
github.com/kulti/thelper v0.6.3
6060
github.com/kunwardeep/paralleltest v1.0.6
6161
github.com/kyoh86/exportloopref v0.1.11
6262
github.com/ldez/gomoddirectives v0.2.3
63-
github.com/ldez/tagliatelle v0.4.0
63+
github.com/ldez/tagliatelle v0.5.0
6464
github.com/leonklingele/grouper v1.1.1
6565
github.com/lufeee/execinquery v1.2.1
6666
github.com/maratori/testableexamples v1.0.0
@@ -75,7 +75,7 @@ require (
7575
github.com/nakabonne/nestif v0.3.1
7676
github.com/nishanths/exhaustive v0.10.0
7777
github.com/nishanths/predeclared v0.2.2
78-
github.com/nunnatsa/ginkgolinter v0.11.0
78+
github.com/nunnatsa/ginkgolinter v0.11.2
7979
github.com/polyfloyd/go-errorlint v1.4.0
8080
github.com/quasilyte/go-ruleguard/dsl v0.3.22
8181
github.com/ryancurrah/gomodguard v1.3.0
@@ -99,7 +99,7 @@ require (
9999
github.com/stretchr/testify v1.8.2
100100
github.com/tdakkota/asciicheck v0.2.0
101101
github.com/tetafro/godot v1.4.11
102-
github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e
102+
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966
103103
github.com/timonwong/loggercheck v0.9.4
104104
github.com/tomarrell/wrapcheck/v2 v2.8.1
105105
github.com/tommy-muehle/go-mnd/v2 v2.5.1
@@ -110,11 +110,13 @@ require (
110110
github.com/xen0n/gosmopolitan v1.2.1
111111
github.com/yagipy/maintidx v1.0.0
112112
github.com/yeya24/promlinter v0.2.0
113+
github.com/ykadowak/zerologlint v0.1.1
113114
gitlab.com/bosi/decorder v0.2.3
115+
go.tmz.dev/musttag v0.6.0
114116
golang.org/x/tools v0.8.0
115117
gopkg.in/yaml.v3 v3.0.1
116118
honnef.co/go/tools v0.4.3
117-
mvdan.cc/gofumpt v0.4.0
119+
mvdan.cc/gofumpt v0.5.0
118120
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
119121
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d
120122
)

0 commit comments

Comments
 (0)