Skip to content

Commit 2ebc9d7

Browse files
authored
dev: clean configuration and code (#1830)
1 parent 714bd28 commit 2ebc9d7

File tree

12 files changed

+11
-42
lines changed

12 files changed

+11
-42
lines changed

.golangci.yml

-26
Original file line numberDiff line numberDiff line change
@@ -133,35 +133,9 @@ issues:
133133
- gocritic
134134
text: "unnecessaryDefer:"
135135

136-
# TODO temporary rule, must be removed
137-
# seems related to v0.34.1, but I was not able to reproduce locally,
138-
# I was also not able to reproduce in the CI of a fork,
139-
# only the golangci-lint CI seems to be affected by this invalid analysis.
140-
- path: pkg/golinters/scopelint.go
141-
text: 'directive `//nolint:interfacer` is unused for linter interfacer'
142-
143-
# TODO temporary rule, must be removed
144-
# related to https://github.com/golangci/golangci-lint/pull/1756
145-
# must be replaced by '//nolint:staticcheck // require changes in github.com/OpenPeeDeeP/depguard'
146-
- path: pkg/golinters/depguard.go
147-
text: 'SA1019: package golang.org/x/tools/go/loader is deprecated'
148-
149-
# TODO temporary rule, must be removed
150-
# related to https://github.com/golangci/golangci-lint/pull/1756
151-
# must be replaced by '///nolint:staticcheck // it's an adapter for golang.org/x/tools/go/packages'
152-
- path: pkg/golinters/goanalysis/adapters.go
153-
text: 'SA1019: package golang.org/x/tools/go/loader is deprecated'
154-
155136
run:
156137
skip-dirs:
157138
- test/testdata_etc
158139
- internal/cache
159140
- internal/renameio
160141
- internal/robustio
161-
162-
# golangci.com configuration
163-
# https://github.com/golangci/golangci/wiki/Configuration
164-
service:
165-
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
166-
prepare:
167-
- echo "here I can run custom commands, but no preparation needed for this repo"

pkg/config/config_gocritic.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import (
55
"sort"
66
"strings"
77

8+
_ "github.com/go-critic/go-critic/checkers" // this import register checkers
89
"github.com/go-critic/go-critic/framework/linter"
910
"github.com/pkg/errors"
1011

11-
_ "github.com/go-critic/go-critic/checkers" // this import register checkers
12-
1312
"github.com/golangci/golangci-lint/pkg/logutils"
1413
)
1514

pkg/config/config_gocritic_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"sort"
66
"testing"
77

8-
"github.com/golangci/golangci-lint/pkg/logutils"
9-
108
"github.com/stretchr/testify/assert"
9+
10+
"github.com/golangci/golangci-lint/pkg/logutils"
1111
)
1212

1313
func TestUtils(t *testing.T) {

pkg/golinters/depguard.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/OpenPeeDeeP/depguard"
99
"golang.org/x/tools/go/analysis"
10-
"golang.org/x/tools/go/loader"
10+
"golang.org/x/tools/go/loader" //nolint:staticcheck // require changes in github.com/OpenPeeDeeP/depguard
1111

1212
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
1313
"github.com/golangci/golangci-lint/pkg/lint/linter"

pkg/golinters/goanalysis/adapters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"go/types"
55

66
"golang.org/x/tools/go/analysis"
7-
"golang.org/x/tools/go/loader"
7+
"golang.org/x/tools/go/loader" //nolint:staticcheck // it's an adapter for golang.org/x/tools/go/packages
88
)
99

1010
func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {

pkg/golinters/gochecknoglobals.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package golinters
22

33
import (
4-
"golang.org/x/tools/go/analysis"
5-
64
"4d63.com/gochecknoglobals/checknoglobals"
5+
"golang.org/x/tools/go/analysis"
76

87
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
98
)

pkg/golinters/unparam.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ package golinters
33
import (
44
"sync"
55

6-
"golang.org/x/tools/go/packages"
7-
86
"golang.org/x/tools/go/analysis"
97
"golang.org/x/tools/go/analysis/passes/buildssa"
8+
"golang.org/x/tools/go/packages"
109
"mvdan.cc/unparam/check"
1110

1211
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"

pkg/result/processors/max_from_linter_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"testing"
55

66
"github.com/golangci/golangci-lint/pkg/config"
7-
87
"github.com/golangci/golangci-lint/pkg/logutils"
98
)
109

pkg/result/processors/processor_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"go/token"
55
"testing"
66

7-
"github.com/golangci/golangci-lint/pkg/result"
8-
97
"github.com/stretchr/testify/assert"
8+
9+
"github.com/golangci/golangci-lint/pkg/result"
1010
)
1111

1212
type issueTestCase struct {

scripts/expand_website_templates/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"strings"
1818

1919
"github.com/golangci/golangci-lint/internal/renameio"
20-
2120
"github.com/golangci/golangci-lint/pkg/lint/linter"
2221
"github.com/golangci/golangci-lint/pkg/lint/lintersdb"
2322
)

test/testdata/fix/in/gofumpt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//args: -Egofumpt
22
//config: linters-settings.gofumpt.extra-rules=true
3-
package testdata
3+
package p
44

55
import "fmt"
66

test/testdata/fix/out/gofumpt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// args: -Egofumpt
22
// config: linters-settings.gofumpt.extra-rules=true
3-
package testdata
3+
package p
44

55
import "fmt"
66

0 commit comments

Comments
 (0)