Skip to content

Commit 63a4570

Browse files
committed
build(deps): bump github.com/OpenPeeDeeP/depguard/v2 from v2.0.1 to 2.1.0 (golangci#3883)
1 parent 68be5ba commit 63a4570

File tree

4 files changed

+74
-11
lines changed

4 files changed

+74
-11
lines changed

.github/workflows/documentation.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
10+
doc:
11+
name: Build and deploy documentation
12+
runs-on: ubuntu-latest
13+
env:
14+
GO_VERSION: '1.20'
15+
NODE_VERSION: '20.x'
16+
CGO_ENABLED: 0
17+
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Go ${{ env.GO_VERSION }}
25+
uses: actions/setup-go@v3
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
29+
- name: Cache Go modules
30+
uses: actions/cache@v3
31+
with:
32+
# In order:
33+
# * Module download cache
34+
# * Build cache (Linux)
35+
path: |
36+
~/go/pkg/mod
37+
~/.cache/go-build
38+
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
39+
restore-keys: |
40+
docs-${{ runner.os }}-go-
41+
42+
- run: go mod download
43+
44+
- name: Use Node.js ${{ env.NODE_VERSION }}
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: ${{ env.NODE_VERSION }}
48+
cache: npm
49+
cache-dependency-path: docs/package-lock.json
50+
51+
- run: npm install --legacy-peer-deps
52+
working-directory: ./docs
53+
54+
- name: Build Documentation
55+
run: npm run build
56+
working-directory: ./docs
57+
58+
- name: Deploy to GitHub Pages
59+
uses: crazy-max/ghaction-github-pages@v3
60+
with:
61+
target_branch: gh-pages
62+
build_dir: docs/public
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
65+

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/BurntSushi/toml v1.3.0
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/v2 v2.1.0
1516
github.com/alexkohler/nakedret/v2 v2.0.1
1617
github.com/alexkohler/prealloc v1.0.0
1718
github.com/alingse/asasalint v0.0.11
@@ -36,7 +37,6 @@ require (
3637
github.com/go-xmlfmt/xmlfmt v1.1.2
3738
github.com/gofrs/flock v0.8.1
3839
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
39-
github.com/golangci/depguard/v2 v2.0.2-0.20230602133032-4f22f8585733
4040
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a
4141
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe
4242
github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2

go.sum

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

pkg/golinters/depguard.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package golinters
22

33
import (
4-
"github.com/golangci/depguard/v2"
4+
"github.com/OpenPeeDeeP/depguard/v2"
55
"golang.org/x/tools/go/analysis"
66

77
"github.com/golangci/golangci-lint/pkg/config"
@@ -33,19 +33,17 @@ func NewDepguard(settings *config.DepGuardSettings) *goanalysis.Linter {
3333
}
3434
}
3535

36-
a := depguard.NewCoreAnalyzer(depguard.CoreSettings{})
36+
a := depguard.NewUncompiledAnalyzer(&conf)
3737

3838
return goanalysis.NewLinter(
39-
a.Name,
40-
a.Doc,
41-
[]*analysis.Analyzer{a},
39+
a.Analyzer.Name,
40+
a.Analyzer.Doc,
41+
[]*analysis.Analyzer{a.Analyzer},
4242
nil,
4343
).WithContextSetter(func(lintCtx *linter.Context) {
44-
coreSettings, err := conf.Compile()
44+
err := a.Compile()
4545
if err != nil {
4646
lintCtx.Log.Errorf("create analyzer: %v", err)
4747
}
48-
49-
a.Run = coreSettings.Run
5048
}).WithLoadMode(goanalysis.LoadModeSyntax)
5149
}

0 commit comments

Comments
 (0)