Skip to content

Commit

Permalink
use go 1.21.9 (#366)
Browse files Browse the repository at this point in the history
* use go 1.21.9

* enable "revive" linter

* use golangci-lint v1.57
  • Loading branch information
mmetc authored May 2, 2024
1 parent aae611b commit 377a76c
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-binary-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.7
go-version: 1.21.9

- name: Build all platforms
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.7
go-version: 1.21.9

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand All @@ -39,7 +39,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.55
version: v1.57
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false
# the cache is already managed above, enabling it here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.7
go-version: 1.21.9

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.7
go-version: 1.21.9

- name: Cache virtualenvs
id: cache-pipenv
Expand Down
120 changes: 119 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,124 @@ linters-settings:
- pkg: "github.com/pkg/errors"
desc: "errors.Wrap() is deprecated in favor of fmt.Errorf()"

revive:
ignore-generated-header: true
severity: error
enable-all-rules: true
rules:
- name: add-constant
disabled: true
- name: argument-limit
disabled: false
- name: bare-return
disabled: false
- name: blank-imports
disabled: false
- name: bool-literal-in-expr
disabled: false
- name: cognitive-complexity
disabled: true
- name: comment-spacings
disabled: true
- name: confusing-naming
disabled: false
- name: confusing-results
disabled: true
- name: context-as-argument
disabled: false
- name: cyclomatic
disabled: true
- name: deep-exit
disabled: false
- name: defer
disabled: false
- name: duplicated-imports
disabled: false
- name: early-return
disabled: false
- name: empty-block
disabled: false
- name: empty-lines
disabled: false
- name: error-naming
disabled: false
- name: error-strings
disabled: false
- name: flag-parameter
disabled: true
- name: function-result-limit
disabled: false
- name: function-length
disabled: true
- name: get-return
disabled: false
- name: if-return
disabled: true
- name: increment-decrement
disabled: false
- name: indent-error-flow
disabled: false
- name: import-alias-naming
disabled: false
- name: import-shadowing
disabled: true
- name: line-length-limit
disabled: true
- name: max-control-nesting
disabled: false
- name: max-public-structs
disabled: false
- name: modifies-parameter
disabled: false
- name: modifies-value-receiver
disabled: false
- name: optimize-operands-order
disabled: false
- name: nested-structs
disabled: true
- name: package-comments
disabled: false
- name: range-val-address
disabled: false
- name: redundant-import-alias
disabled: false
- name: struct-tag
disabled: false
- name: superfluous-else
disabled: false
- name: time-equal
disabled: false
- name: var-naming
disabled: false
- name: var-declaration
disabled: false
- name: unchecked-type-assertion
disabled: false
- name: exported
disabled: true
- name: unexported-naming
disabled: false
- name: unexported-return
disabled: true
- name: unhandled-error
disabled: false
arguments:
- "fmt.Print"
- "fmt.Printf"
- "fmt.Println"
- name: unnecessary-stmt
disabled: false
- name: unreachable-code
disabled: false
- name: unused-parameter
disabled: false
- name: unused-receiver
disabled: true
- name: use-any
disabled: false
- name: useless-break
disabled: false

linters:
enable-all: true
disable:
Expand Down Expand Up @@ -121,6 +239,7 @@ linters:
# - predeclared # find code that shadows one of Go's predeclared identifiers
# - promlinter # Check Prometheus metrics naming via promlint
# - reassign # Checks that package variables are not reassigned
# - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
# - rowserrcheck # checks whether Err of rows is checked successfully
# - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
# - staticcheck # (megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks
Expand All @@ -139,7 +258,6 @@ linters:
#
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
- gosec # (gas): Inspects source code for security problems
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
- wrapcheck # Checks that errors returned from external packages are wrapped

#
Expand Down

0 comments on commit 377a76c

Please sign in to comment.