Skip to content

Commit b6fd479

Browse files
authored
Merge pull request #10 from uudashr/fix-debugflag-coflict
Use nerd flag to avoid flag conflict
2 parents 68fc2f7 + 5e68c07 commit b6fd479

File tree

5 files changed

+45
-31
lines changed

5 files changed

+45
-31
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535
- uses: actions/setup-go@v5
3636
with:
3737
go-version: oldstable
38-
- uses: golangci/golangci-lint-action@v6
38+
- uses: golangci/golangci-lint-action@v8
3939
with:
40-
version: latest
40+
version: v2.1

.golangci.yml

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1+
version: "2"
12
linters:
23
enable:
3-
- errcheck
4-
- gosimple
5-
- govet
6-
- ineffassign
7-
- staticcheck
8-
- unused
94
- asasalint
105
- asciicheck
116
- bidichk
@@ -24,7 +19,6 @@ linters:
2419
- errorlint
2520
- exhaustive
2621
- fatcontext
27-
- gci
2822
- ginkgolinter
2923
- gocheckcompilerdirectives
3024
- gochecknoinits
@@ -33,10 +27,7 @@ linters:
3327
- gocritic
3428
- godot
3529
- godox
36-
- gofmt
37-
- gofumpt
3830
- goheader
39-
- goimports
4031
- gomoddirectives
4132
- gomodguard
4233
- goprintffuncname
@@ -73,7 +64,6 @@ linters:
7364
- spancheck
7465
- tagalign
7566
- tagliatelle
76-
- tenv
7767
- testableexamples
7868
- testifylint
7969
- testpackage
@@ -85,18 +75,40 @@ linters:
8575
- whitespace
8676
- wsl
8777
- zerologlint
88-
89-
linters-settings:
90-
varnamelen:
91-
ignore-type-assert-ok: true
92-
ignore-decls:
93-
- i int
94-
- tx *sql.Tx
95-
- ts *ast.TypeSpec
96-
- fn *ast.FuncDecl
97-
- fun *ast.FuncDecl
98-
- fnDecl *ast.FuncDecl
99-
- funDecl *ast.FuncDecl
100-
mnd:
101-
ignored-numbers:
102-
- "2"
78+
settings:
79+
mnd:
80+
ignored-numbers:
81+
- "2"
82+
varnamelen:
83+
ignore-type-assert-ok: true
84+
ignore-decls:
85+
- i int
86+
- tx *sql.Tx
87+
- ts *ast.TypeSpec
88+
- fn *ast.FuncDecl
89+
- fun *ast.FuncDecl
90+
- fnDecl *ast.FuncDecl
91+
- funDecl *ast.FuncDecl
92+
exclusions:
93+
generated: lax
94+
presets:
95+
- comments
96+
- common-false-positives
97+
- legacy
98+
- std-error-handling
99+
paths:
100+
- third_party$
101+
- builtin$
102+
- examples$
103+
formatters:
104+
enable:
105+
- gci
106+
- gofmt
107+
- gofumpt
108+
- goimports
109+
exclusions:
110+
generated: lax
111+
paths:
112+
- third_party$
113+
- builtin$
114+
- examples$

identical/identical.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func newAnalyzer() *analysis.Analyzer {
2727
Run: r.run,
2828
}
2929

30-
analyzer.Flags.BoolVar(&r.debug, "debug", false, "enable debug mode")
30+
analyzer.Flags.BoolVar(&r.debug, "nerd", false, "enable nerd mode")
3131

3232
return analyzer
3333
}

opaque/opaque.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func newAnalyzer() *analysis.Analyzer {
2727
Run: r.run,
2828
}
2929

30-
analyzer.Flags.BoolVar(&r.debug, "debug", false, "enable debug mode")
30+
analyzer.Flags.BoolVar(&r.debug, "nerd", false, "enable nerd mode")
3131

3232
return analyzer
3333
}

unused/unused.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func newAnalyzer() *analysis.Analyzer {
2828
Run: r.run,
2929
}
3030

31-
analyzer.Flags.BoolVar(&r.debug, "debug", false, "enable debug mode")
31+
analyzer.Flags.BoolVar(&r.debug, "nerd", false, "enable nerd mode")
3232
analyzer.Flags.StringVar(&r.exclude, "exclude", "", "comma-separated list of packages to exclude from the check")
3333

3434
return analyzer
@@ -40,6 +40,8 @@ type runner struct {
4040
}
4141

4242
func (r *runner) run(pass *analysis.Pass) (interface{}, error) {
43+
fmt.Println("Running unused interface analyzer")
44+
4345
excludes := strings.Split(r.exclude, ",")
4446
if slices.Contains(excludes, pass.Pkg.Path()) {
4547
return nil, nil

0 commit comments

Comments
 (0)