Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate 'scopelint' linter #1819

Merged
merged 2 commits into from Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .golangci.yml
Expand Up @@ -73,6 +73,7 @@ linters:
- dogsled
- dupl
- errcheck
- exportloopref
- exhaustive
- funlen
- gochecknoinits
Expand All @@ -94,7 +95,6 @@ linters:
- noctx
- nolintlint
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
Expand All @@ -107,6 +107,7 @@ linters:

# don't enable:
# - asciicheck
# - scopelint
# - gochecknoglobals
# - gocognit
# - godot
Expand Down
1 change: 0 additions & 1 deletion go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/golinters/gofmt_common.go
Expand Up @@ -176,7 +176,7 @@ func (p *hunkChangesParser) parse(h *diffpkg.Hunk) []Change {
for i := 0; i < len(p.lines); {
line := p.lines[i]
if line.typ == diffLineOriginal {
p.handleOriginalLine(line, &i) //nolint:scopelint
p.handleOriginalLine(line, &i)
continue
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/lint/lintersdb/manager.go
Expand Up @@ -271,7 +271,8 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithURL("https://github.com/alexkohler/prealloc"),
linter.NewConfig(golinters.NewScopelint()).
WithPresets(linter.PresetBugs).
WithURL("https://github.com/kyoh86/scopelint"),
WithURL("https://github.com/kyoh86/scopelint").
Deprecated("The repository of the linter has been deprecated by the owner. Use 'exportloopref' instead."),
linter.NewConfig(golinters.NewGocritic()).
WithPresets(linter.PresetStyle).
WithLoadForGoAnalysis().
Expand Down
2 changes: 1 addition & 1 deletion pkg/result/processors/fixer.go
Expand Up @@ -57,7 +57,7 @@ func (f Fixer) Process(issues []result.Issue) []result.Issue {
for file, issuesToFix := range issuesToFixPerFile {
var err error
f.sw.TrackStage("all", func() {
err = f.fixIssuesInFile(file, issuesToFix) //nolint:scopelint
err = f.fixIssuesInFile(file, issuesToFix)
})
if err != nil {
f.log.Errorf("Failed to fix issues in file %s: %s", file, err)
Expand Down
6 changes: 3 additions & 3 deletions pkg/result/processors/path_prefixer_test.go
Expand Up @@ -27,11 +27,11 @@ func TestPathPrefixer_Process(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
r := require.New(t)

p := NewPathPrefixer(tt.prefix) //nolint:scopelint
got, err := p.Process(tt.issues) //nolint:scopelint
p := NewPathPrefixer(tt.prefix)
got, err := p.Process(tt.issues)
r.NoError(err, "prefixer should never error")

r.Equal(got, tt.want) //nolint:scopelint
r.Equal(got, tt.want)
})
}
}
4 changes: 2 additions & 2 deletions test/run_test.go
Expand Up @@ -337,9 +337,9 @@ func TestPathPrefix(t *testing.T) {
} {
t.Run(tt.Name, func(t *testing.T) {
testshared.NewLintRunner(t).Run(
append(tt.Args, getTestDataDir("withtests"))..., //nolint:scopelint
append(tt.Args, getTestDataDir("withtests"))...,
).ExpectOutputRegexp(
tt.Pattern, //nolint:scopelint
tt.Pattern,
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/scopelint.go
@@ -1,4 +1,4 @@
//args: -Escopelint
//args: -Escopelint --internal-cmd-test
package testdata

import "fmt"
Expand Down