diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cd880aa32..338afcef6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,11 +15,11 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: lint uses: golangci/golangci-lint-action@v3.4.0 with: - version: v1.48.0 + version: v1.50.1 tests-on-unix: needs: golangci-lint # run after golangci-lint action to not produce duplicated errors @@ -27,8 +27,9 @@ jobs: strategy: matrix: golang: - - 1.18 - - 1.19 + - "1.18" + - "1.19" + - "1.20" steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.golangci.yml b/.golangci.yml index 19e333fe9..eb74214bf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -61,7 +61,6 @@ linters: disable-all: true enable: - bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false] - - deadcode # Finds unused code [fast: false, auto-fix: false] - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: false, auto-fix: false] - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] @@ -84,20 +83,19 @@ linters: - nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false] - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false] - rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false] - - staticcheck #megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false] - - structcheck # Finds unused struct fields [fast: false, auto-fix: false] + - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false] - stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false] - thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false] - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false] - unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false] - unparam # Reports unused function parameters [fast: false, auto-fix: false] - unused # Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] - - varcheck # Finds unused global variables and constants [fast: false, auto-fix: false] - whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] # don't enable: # - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] # - cyclop # checks function and package cyclomatic complexity [fast: false, auto-fix: false] +# - deadcode # Finds unused code [fast: false, auto-fix: false] # - dupl # Tool for code clone detection [fast: true, auto-fix: false] # - durationcheck # check for two durations multiplied together [fast: false, auto-fix: false] # - exhaustivestruct # Checks if all struct's fields are initialized [fast: false, auto-fix: false] @@ -130,9 +128,11 @@ linters: # - promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false] # - scopelint # Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false] # - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false] +# - structcheck # Finds unused struct fields [fast: false, auto-fix: false] # - testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] # - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false] # - wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false] # - wrapcheck # Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false] # - wsl # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false] +# - varcheck # Finds unused global variables and constants [fast: false, auto-fix: false] # - ifshort # Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false] diff --git a/GNUmakefile b/GNUmakefile index 2df687c8a..0a154324c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ SOURCE_FILES?=./... PKG_NAME=mongodbatlas -GOLANGCI_VERSION=v1.48.0 +GOLANGCI_VERSION=v1.50.1 COVERAGE=coverage.out export GO111MODULE := on