File tree 4 files changed +74
-11
lines changed
4 files changed +74
-11
lines changed Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ require (
12
12
github.com/BurntSushi/toml v1.3.0
13
13
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24
14
14
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0
15
+ github.com/OpenPeeDeeP/depguard/v2 v2.1.0
15
16
github.com/alexkohler/nakedret/v2 v2.0.1
16
17
github.com/alexkohler/prealloc v1.0.0
17
18
github.com/alingse/asasalint v0.0.11
@@ -36,7 +37,6 @@ require (
36
37
github.com/go-xmlfmt/xmlfmt v1.1.2
37
38
github.com/gofrs/flock v0.8.1
38
39
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
39
- github.com/golangci/depguard/v2 v2.0.2-0.20230602133032-4f22f8585733
40
40
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a
41
41
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe
42
42
github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2
Original file line number Diff line number Diff line change 1
1
package golinters
2
2
3
3
import (
4
- "github.com/golangci /depguard/v2"
4
+ "github.com/OpenPeeDeeP /depguard/v2"
5
5
"golang.org/x/tools/go/analysis"
6
6
7
7
"github.com/golangci/golangci-lint/pkg/config"
@@ -33,19 +33,17 @@ func NewDepguard(settings *config.DepGuardSettings) *goanalysis.Linter {
33
33
}
34
34
}
35
35
36
- a := depguard .NewCoreAnalyzer (depguard. CoreSettings {} )
36
+ a := depguard .NewUncompiledAnalyzer ( & conf )
37
37
38
38
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 },
42
42
nil ,
43
43
).WithContextSetter (func (lintCtx * linter.Context ) {
44
- coreSettings , err := conf .Compile ()
44
+ err := a .Compile ()
45
45
if err != nil {
46
46
lintCtx .Log .Errorf ("create analyzer: %v" , err )
47
47
}
48
-
49
- a .Run = coreSettings .Run
50
48
}).WithLoadMode (goanalysis .LoadModeSyntax )
51
49
}
You can’t perform that action at this time.
0 commit comments