Skip to content

Commit

Permalink
ci: update golangci-lint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn committed Nov 8, 2024
1 parent fb15167 commit 0653f42
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18.x, 1.21.x]
go-version: [1.18.x, 1.23.x]
steps:
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: golangci-lint

on:
push:
branches:
- master
- '**'
pull_request:
branches:
- master

permissions:
contents: read

jobs:
golangci:
Expand All @@ -13,5 +19,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
- name: Get go version from go.mod
run: |
echo "GO_VERSION=$(grep '^go ' go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- name: Setup-go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
8 changes: 7 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ linters:
enable:
- dupl
- errcheck
- exportloopref
- funlen
- gci
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nolintlint
- prealloc
- revive
- staticcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
Expand All @@ -32,6 +35,9 @@ linters-settings:
gocritic:
disabled-checks:
- exitAfterDefer
thelper:
test:
begin: false

issues:
exclude-rules:
Expand Down

0 comments on commit 0653f42

Please sign in to comment.