Skip to content

Commit

Permalink
Deprecate 'scopelint' linter (#1819)
Browse files Browse the repository at this point in the history
* Deprecate scopelint linter

* clean code base.
  • Loading branch information
ldez committed Mar 9, 2021
1 parent 8d0075d commit fce3949
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
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

0 comments on commit fce3949

Please sign in to comment.