diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bacb81e7..47c14445 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,6 @@ -name: golangci-lint +# Lint the entire golang project. This workflow relies on the +# '.golangci.yml' file for its configuration settings. +name: Lint on: push: tags: @@ -7,15 +9,26 @@ on: - master - main pull_request: + +permissions: + contents: read + +env: + GO_VERSION: 1.21 + jobs: golangci: - name: lint + name: golangci-lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - uses: actions/checkout@v4 + - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6.1.0 with: - version: latest - only-new-issues: true - args: --timeout=3m + version: v1.57.2 + args: --timeout 15m \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 8fe7a04a..c18569cf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,29 +1,70 @@ +run: + timeout: 10m + tests: true + +# These linter checks can be modified on a per project basis. +# Simply remove them from the enable list to disable them. linters: + disable-all: true enable: + - asciicheck + - bidichk - bodyclose - - dogsled + - decorder + - dupl + - dupword + - errcheck + - errchkjson + - errname + - exhaustive + - exportloopref + - forbidigo + - gci - goconst - gocritic - - gofmt - - goimports + - godot + - gofumpt - gosec - gosimple + - gosmopolitan - govet - - importas + - grouper - ineffassign - - lll + - loggercheck - misspell - - nakedret - - prealloc - - revive + - nilerr + - nilnil + - noctx - staticcheck - stylecheck + - testifylint + - thelper + - tparallel - typecheck - unconvert + - unparam - unused - - nolintlint + - usestdlibvars + - wastedassign + - whitespace linters-settings: + gci: + custom-order: true + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - blank # blank imports + - dot # dot imports + - prefix(cosmossdk.io) + - prefix(github.com/cosmos) + - prefix(github.com/cosmos/cosmos-sdk) + - prefix(github.com/cometbft/cometbft) + # TODO: Replace below with '- prefix()' + - prefix(github.com/strangelove-ventures/horcrux) + gosec: + excludes: + - G404 # disables checks on insecure random number source dogsled: max-blank-identifiers: 3 importas: @@ -99,8 +140,6 @@ linters-settings: alias: boltdb - pkg: math/rand alias: mrand - maligned: - suggest-new: true - govet: - misspell: - locale: US + +issues: + max-issues-per-linter: 0