Skip to content

Commit

Permalink
core: add default config
Browse files Browse the repository at this point in the history
Add default config, correct want and fix linter name.
  • Loading branch information
stevenh committed Nov 8, 2022
1 parent 10fd3e0 commit 5d2af72
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -93,7 +93,7 @@ require (
github.com/spf13/viper v1.12.0
github.com/ssgreg/nlreturn/v2 v2.2.1
github.com/stbenjam/no-sprintf-host-port v0.1.1
github.com/stevenh/go-uncalled v0.7.1
github.com/stevenh/go-uncalled v0.7.3
github.com/stretchr/testify v1.8.1
github.com/tdakkota/asciicheck v0.1.1
github.com/tetafro/godot v1.4.11
Expand Down
8 changes: 2 additions & 6 deletions go.sum

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

1 change: 1 addition & 0 deletions pkg/config/linters_settings.go
Expand Up @@ -109,6 +109,7 @@ var defaultLintersSettings = LintersSettings{
SkipRegexp: `(export|internal)_test\.go`,
AllowPackages: []string{"main"},
},
Uncalled: uncalled.DefaultConfig(),
Unparam: UnparamSettings{
Algo: "cha",
},
Expand Down
1 change: 1 addition & 0 deletions test/linters_test.go
Expand Up @@ -30,6 +30,7 @@ func TestTypecheck(t *testing.T) {
func TestSourcesFromTestdataSubDir(t *testing.T) {
subDirs := []string{
"loggercheck",
"uncalled",
}

for _, dir := range subDirs {
Expand Down
4 changes: 2 additions & 2 deletions test/testdata/uncalled/uncalled.go
@@ -1,12 +1,12 @@
//golangcitest:args -Erowserr
//golangcitest:args -Euncalled
package testdata

import (
"database/sql"
)

func RowsErrNotChecked(db *sql.DB) {
rows, err := db.Query("select id from tb") // want "rows.Err\\(\\) must be checked"
rows, err := db.Query("select id from tb") // want "rows.Err\\(\\) must be called"
if err != nil {
// Handle error.
}
Expand Down

0 comments on commit 5d2af72

Please sign in to comment.