Skip to content

Commit

Permalink
ci: update golangci-lint configuration (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn authored Sep 7, 2024
1 parent cb3ec9e commit 53f371f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
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@v4
- 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.60.3
28 changes: 24 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,53 @@
run:
skip-dirs:
- benchmarks
timeout: 2m

linters:
disable-all: true
enable:
- dupl
- errcheck
- exportloopref
- errname
- errorlint
- funlen
- gci
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nolintlint
- prealloc
- revive
- staticcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- whitespace

linters-settings:
gosec:
excludes:
- G115
thelper:
test:
begin: false

issues:
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- errcheck
- funlen

exclude-dirs:
- benchmarks
1 change: 0 additions & 1 deletion value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/reugn/async/internal/util"
)

//nolint:funlen
func TestValueCompareAndSwap(t *testing.T) {
var value Value
swapped := value.CompareAndSwap(1, 2)
Expand Down

0 comments on commit 53f371f

Please sign in to comment.