Skip to content

Commit 933ba6f

Browse files
authored
Merge branch 'master' into path-filtering
2 parents 33826ae + 69e5481 commit 933ba6f

15 files changed

+61
-54
lines changed

Diff for: .golangci.reference.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1924,48 +1924,48 @@ linters-settings:
19241924
# this is set to true - the append call must append either a variable
19251925
# assigned, called or used on the line above.
19261926
strict-append: true
1927-
1927+
19281928
# Allows assignments to be cuddled with variables used in calls on
19291929
# line above and calls to be cuddled with assignments of variables
19301930
# used in call on line above.
19311931
allow-assign-and-call: true
1932-
1932+
19331933
# Allows assignments to be cuddled with anything.
19341934
allow-assign-and-anything: false
1935-
1935+
19361936
# Allows cuddling to assignments even if they span over multiple lines.
19371937
allow-multiline-assign: true
1938-
1938+
19391939
# If the number of lines in a case block is equal to or lager than this
19401940
# number, the case *must* end white a newline.
19411941
force-case-trailing-whitespace: 0
1942-
1942+
19431943
# Allow blocks to end with comments.
19441944
allow-trailing-comment: false
1945-
1945+
19461946
# Allow multiple comments in the beginning of a block separated with newline.
19471947
allow-separated-leading-comment: false
1948-
1948+
19491949
# Allow multiple var/declaration statements to be cuddled.
19501950
allow-cuddle-declarations: false
1951-
1951+
19521952
# A list of call idents that everything can be cuddled with.
19531953
# Defaults to calls looking like locks.
19541954
allow-cuddle-with-calls: [ "Lock", "RLock" ]
1955-
1955+
19561956
# AllowCuddleWithRHS is a list of right hand side variables that is allowed
19571957
# to be cuddled with anything. Defaults to assignments or calls looking
19581958
# like unlocks.
19591959
allow-cuddle-with-rhs: [ "Unlock", "RUnlock" ]
1960-
1960+
19611961
# Causes an error when an If statement that checks an error variable doesn't
19621962
# cuddle with the assignment of that variable.
19631963
force-err-cuddling: false
1964-
1964+
19651965
# When force-err-cuddling is enabled this is a list of names
19661966
# used for error variables to check for in the conditional.
19671967
error-variable-names: [ "err" ]
1968-
1968+
19691969
# Causes an error if a short declaration (:=) cuddles with anything other than
19701970
# another short declaration.
19711971
# This logic overrides force-err-cuddling among others.

Diff for: .goreleaser.yml

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ changelog:
7373
- Merge pull request
7474
- Merge branch
7575

76+
source:
77+
enabled: true
78+
name_template: '{{ .ProjectName }}-{{ .Version }}-source'
79+
7680
brews:
7781
- tap:
7882
owner: golangci

Diff for: CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at idenx@yandex.com. All
58+
reported by contacting the project team at info@golangci.com. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

Diff for: docs/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: docs/src/docs/contributing/architecture.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*l
126126
```
127127

128128
First, we find a load mode as union of load modes for all enabled linters.
129-
We use [go/packages](https://godoc.org/golang.org/x/tools/go/packages) for packages loading and use it's enum `packages.Need*` for load modes.
129+
We use [go/packages](https://pkg.go.dev/golang.org/x/tools/go/packages) for packages loading and use it's enum `packages.Need*` for load modes.
130130
Load mode sets which data does a linter needs for execution.
131131

132132
A linter that works only with AST need minimum of information: only filenames and AST. There is no need for
@@ -165,7 +165,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
165165
WithLoadForGoAnalysis().
166166
WithPresets(linter.PresetBugs).
167167
WithAlternativeNames("vet", "vetshadow").
168-
WithURL("https://golang.org/cmd/vet/"),
168+
WithURL("https://pkg.go.dev/cmd/vet"),
169169
linter.NewConfig(golinters.NewBodyclose()).
170170
WithLoadForGoAnalysis().
171171
WithPresets(linter.PresetPerformance, linter.PresetBugs).
@@ -208,10 +208,10 @@ Currently, all linters except `unused` can be merged into this meta linter.
208208
The `unused` isn't merged because it has high memory usage.
209209

210210
Linters execution starts in `runAnalyzers`. It's the most complex part of the `golangci-lint`.
211-
We use custom [go/analysis](https://godoc.org/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can
211+
We use custom [go/analysis](https://pkg.go.dev/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can
212212
to reduce memory usage. Also, it sets all heavyweight data to `nil` as becomes unneeded to save memory.
213213

214-
We don't use existing [multichecker](https://godoc.org/golang.org/x/tools/go/analysis/multichecker) because
214+
We don't use existing [multichecker](https://pkg.go.dev/golang.org/x/tools/go/analysis/multichecker) because
215215
it doesn't use caching and doesn't have some important performance optimizations.
216216

217217
All found by linters issues are represented with `result.Issue` struct:

Diff for: docs/src/docs/contributing/workflow.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ conduct](https://github.com/golangci/golangci-lint/blob/master/CODE_OF_CONDUCT.m
99

1010
## Setup your machine
1111

12-
`golangci-lint` is written in [Go](https://golang.org/).
12+
`golangci-lint` is written in [Go](https://go.dev).
1313

1414
Prerequisites:
1515

1616
- `make`
17-
- [Go](https://golang.org/doc/install)
17+
- [Go](https://go.dev/doc/install)
1818

1919
Fork and clone [golangci-lint](https://github.com/golangci/golangci-lint) repository.
2020

Diff for: docs/src/docs/usage/configuration.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ the `go tool trace` command and visualization tool.
4848

4949
## Cache
5050

51-
GolangCI-Lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://golang.org/pkg/os/#UserCacheDir).
51+
GolangCI-Lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://pkg.go.dev/os#UserCacheDir).
5252

5353
You can override the default cache directory with the environment variable `GOLANGCI_LINT_CACHE`; the path must be absolute.

Diff for: docs/src/docs/usage/performance.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Performance
44

55
## Memory Usage
66

7-
A trade-off between memory usage and execution time can be controlled by [`GOGC`](https://golang.org/pkg/runtime/#hdr-Environment_Variables) environment variable.
7+
A trade-off between memory usage and execution time can be controlled by [`GOGC`](https://pkg.go.dev/runtime#hdr-Environment_Variables) environment variable.
88
Less `GOGC` values trigger garbage collection more frequently and golangci-lint consumes less memory and more CPU. Below is the trade-off table for running on this repo:
99

1010
| `GOGC` | Peak Memory, GB | Execution Time, s |

Diff for: go.mod

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/OpenPeeDeeP/depguard v1.1.1
1515
github.com/alexkohler/prealloc v1.0.0
1616
github.com/alingse/asasalint v0.0.11
17-
github.com/ashanbrown/forbidigo v1.3.0
17+
github.com/ashanbrown/forbidigo v1.4.0
1818
github.com/ashanbrown/makezero v1.1.1
1919
github.com/bkielbasa/cyclop v1.2.0
2020
github.com/blizzy78/varnamelen v0.8.0
@@ -52,7 +52,7 @@ require (
5252
github.com/jingyugao/rowserrcheck v1.1.1
5353
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af
5454
github.com/julz/importas v0.1.0
55-
github.com/junk1tm/musttag v0.4.4
55+
github.com/junk1tm/musttag v0.4.5
5656
github.com/kisielk/errcheck v1.6.3
5757
github.com/kkHAIKE/contextcheck v1.1.3
5858
github.com/kulti/thelper v0.6.3
@@ -76,7 +76,7 @@ require (
7676
github.com/nishanths/predeclared v0.2.2
7777
github.com/nunnatsa/ginkgolinter v0.8.1
7878
github.com/pkg/errors v0.9.1
79-
github.com/polyfloyd/go-errorlint v1.0.6
79+
github.com/polyfloyd/go-errorlint v1.1.0
8080
github.com/quasilyte/go-ruleguard/dsl v0.3.22
8181
github.com/ryancurrah/gomodguard v1.3.0
8282
github.com/ryanrolds/sqlclosecheck v0.4.0
@@ -110,9 +110,9 @@ require (
110110
github.com/yagipy/maintidx v1.0.0
111111
github.com/yeya24/promlinter v0.2.0
112112
gitlab.com/bosi/decorder v0.2.3
113-
golang.org/x/tools v0.5.0
113+
golang.org/x/tools v0.6.0
114114
gopkg.in/yaml.v3 v3.0.1
115-
honnef.co/go/tools v0.4.0
115+
honnef.co/go/tools v0.4.2
116116
mvdan.cc/gofumpt v0.4.0
117117
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
118118
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d
@@ -180,9 +180,9 @@ require (
180180
go.uber.org/zap v1.17.0 // indirect
181181
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
182182
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
183-
golang.org/x/mod v0.7.0 // indirect
183+
golang.org/x/mod v0.8.0 // indirect
184184
golang.org/x/sync v0.1.0 // indirect
185-
golang.org/x/sys v0.4.0 // indirect
185+
golang.org/x/sys v0.5.0 // indirect
186186
golang.org/x/text v0.6.0 // indirect
187187
google.golang.org/protobuf v1.28.0 // indirect
188188
gopkg.in/ini.v1 v1.67.0 // indirect

Diff for: go.sum

+15-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pkg/golinters/forbidigo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func runForbidigo(pass *analysis.Pass, settings *config.ForbidigoSettings) ([]go
6464

6565
var issues []goanalysis.Issue
6666
for _, file := range pass.Files {
67-
hints, err := forbid.Run(pass.Fset, file)
67+
hints, err := forbid.RunWithConfig(forbidigo.RunConfig{Fset: pass.Fset}, file)
6868
if err != nil {
6969
return nil, errors.Wrapf(err, "forbidigo linter failed on file %q", file.Name.String())
7070
}

Diff for: pkg/golinters/govet.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var (
8989
unusedwrite.Analyzer,
9090
}
9191

92-
// https://github.com/golang/go/blob/879db69ce2de814bc3203c39b45617ba51cc5366/src/cmd/vet/main.go#L40-L68
92+
// https://github.com/golang/go/blob/9f834a559c9ed6cdf883e29b36e21e5f956df74f/src/cmd/vet/main.go#L46-L76
9393
defaultAnalyzers = []*analysis.Analyzer{
9494
asmdecl.Analyzer,
9595
assign.Analyzer,
@@ -114,6 +114,7 @@ var (
114114
structtag.Analyzer,
115115
testinggoroutine.Analyzer,
116116
tests.Analyzer,
117+
timeformat.Analyzer,
117118
unmarshal.Analyzer,
118119
unreachable.Analyzer,
119120
unsafeptr.Analyzer,

0 commit comments

Comments
 (0)