Skip to content

Commit

Permalink
dev: clean configuration and code (#1830)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Mar 9, 2021
1 parent 714bd28 commit 2ebc9d7
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 42 deletions.
26 changes: 0 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,35 +133,9 @@ issues:
- gocritic
text: "unnecessaryDefer:"

# TODO temporary rule, must be removed
# seems related to v0.34.1, but I was not able to reproduce locally,
# I was also not able to reproduce in the CI of a fork,
# only the golangci-lint CI seems to be affected by this invalid analysis.
- path: pkg/golinters/scopelint.go
text: 'directive `//nolint:interfacer` is unused for linter interfacer'

# TODO temporary rule, must be removed
# related to https://github.com/golangci/golangci-lint/pull/1756
# must be replaced by '//nolint:staticcheck // require changes in github.com/OpenPeeDeeP/depguard'
- path: pkg/golinters/depguard.go
text: 'SA1019: package golang.org/x/tools/go/loader is deprecated'

# TODO temporary rule, must be removed
# related to https://github.com/golangci/golangci-lint/pull/1756
# must be replaced by '///nolint:staticcheck // it's an adapter for golang.org/x/tools/go/packages'
- path: pkg/golinters/goanalysis/adapters.go
text: 'SA1019: package golang.org/x/tools/go/loader is deprecated'

run:
skip-dirs:
- test/testdata_etc
- internal/cache
- internal/renameio
- internal/robustio

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
3 changes: 1 addition & 2 deletions pkg/config/config_gocritic.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"sort"
"strings"

_ "github.com/go-critic/go-critic/checkers" // this import register checkers
"github.com/go-critic/go-critic/framework/linter"
"github.com/pkg/errors"

_ "github.com/go-critic/go-critic/checkers" // this import register checkers

"github.com/golangci/golangci-lint/pkg/logutils"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config_gocritic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"sort"
"testing"

"github.com/golangci/golangci-lint/pkg/logutils"

"github.com/stretchr/testify/assert"

"github.com/golangci/golangci-lint/pkg/logutils"
)

func TestUtils(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/depguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/OpenPeeDeeP/depguard"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/loader"
"golang.org/x/tools/go/loader" //nolint:staticcheck // require changes in github.com/OpenPeeDeeP/depguard

"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
"github.com/golangci/golangci-lint/pkg/lint/linter"
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/goanalysis/adapters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"go/types"

"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/loader"
"golang.org/x/tools/go/loader" //nolint:staticcheck // it's an adapter for golang.org/x/tools/go/packages
)

func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {
Expand Down
3 changes: 1 addition & 2 deletions pkg/golinters/gochecknoglobals.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package golinters

import (
"golang.org/x/tools/go/analysis"

"4d63.com/gochecknoglobals/checknoglobals"
"golang.org/x/tools/go/analysis"

"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/golinters/unparam.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package golinters
import (
"sync"

"golang.org/x/tools/go/packages"

"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/buildssa"
"golang.org/x/tools/go/packages"
"mvdan.cc/unparam/check"

"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
Expand Down
1 change: 0 additions & 1 deletion pkg/result/processors/max_from_linter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/golangci/golangci-lint/pkg/config"

"github.com/golangci/golangci-lint/pkg/logutils"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/result/processors/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"go/token"
"testing"

"github.com/golangci/golangci-lint/pkg/result"

"github.com/stretchr/testify/assert"

"github.com/golangci/golangci-lint/pkg/result"
)

type issueTestCase struct {
Expand Down
1 change: 0 additions & 1 deletion scripts/expand_website_templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"strings"

"github.com/golangci/golangci-lint/internal/renameio"

"github.com/golangci/golangci-lint/pkg/lint/linter"
"github.com/golangci/golangci-lint/pkg/lint/lintersdb"
)
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/fix/in/gofumpt.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//args: -Egofumpt
//config: linters-settings.gofumpt.extra-rules=true
package testdata
package p

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion test/testdata/fix/out/gofumpt.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// args: -Egofumpt
// config: linters-settings.gofumpt.extra-rules=true
package testdata
package p

import "fmt"

Expand Down

0 comments on commit 2ebc9d7

Please sign in to comment.