Skip to content

Commit

Permalink
ci: revise golangci-lint settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jtieri committed Aug 21, 2024
1 parent 735808b commit 8c50fc9
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 21 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
67 changes: 53 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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(<project-package-name>)'
- prefix(github.com/strangelove-ventures/horcrux)
gosec:
excludes:
- G404 # disables checks on insecure random number source
dogsled:
max-blank-identifiers: 3
importas:
Expand Down Expand Up @@ -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

0 comments on commit 8c50fc9

Please sign in to comment.