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

Upgrade golangci-lint and config, address findings #258

Merged
merged 4 commits into from
Jan 8, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
version: v1.55.2
- name: go mod tidy
run: go mod tidy
- name: check for any changes
Expand Down
15 changes: 12 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ linters-settings:
disable:
- fieldalignment
depguard:
list-type: blacklist
include-go-root: true
include-go-std-lib: true
rules:
main:
allow:
- $gostd
- github.com/denisenkom/go-mssqldb
- github.com/go-sql-driver/mysql
- github.com/go-gorp/gorp/v3
- github.com/lib/pq
- github.com/mattn/go-sqlite3
- github.com/mitchellh/cli
- github.com/olekukonko/tablewriter
- github.com/rubenv/sql-migrate
exhaustive:
default-signifies-exhaustive: true
nolintlint:
Expand Down
1 change: 1 addition & 0 deletions init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package migrate
import (
"testing"

//revive:disable-next-line:dot-imports
. "gopkg.in/check.v1"
)

Expand Down
4 changes: 3 additions & 1 deletion migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import (
"time"

"github.com/go-gorp/gorp/v3"
_ "github.com/mattn/go-sqlite3"
//revive:disable-next-line:dot-imports
. "gopkg.in/check.v1"

_ "github.com/mattn/go-sqlite3"
)

var sqliteMigrations = []*Migration{
Expand Down
1 change: 1 addition & 0 deletions sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package migrate
import (
"sort"

//revive:disable-next-line:dot-imports
. "gopkg.in/check.v1"
)

Expand Down
3 changes: 1 addition & 2 deletions sql-migrate/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"flag"
"fmt"
"io/ioutil"
"os"
"runtime/debug"

Expand Down Expand Up @@ -45,7 +44,7 @@ type Environment struct {
}

func ReadConfig() (map[string]*Environment, error) {
file, err := ioutil.ReadFile(ConfigFile)
file, err := os.ReadFile(ConfigFile)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions sqlparse/sqlparse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"strings"
"testing"

//revive:disable-next-line:dot-imports
. "gopkg.in/check.v1"
)

Expand Down
1 change: 1 addition & 0 deletions toapply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package migrate
import (
"sort"

//revive:disable-next-line:dot-imports
. "gopkg.in/check.v1"
)

Expand Down
Loading