Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: linter
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
branches:
- "*"
Expand All @@ -16,15 +16,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.22"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
version: v2.3.1

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down Expand Up @@ -58,4 +58,4 @@ jobs:
- uses: actions/checkout@v4

- name: Lint YAML files
run: yamllint . # YAML lint is already installed in ubuntu-latest
run: yamllint . # YAML lint is already installed in ubuntu-latest
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: unittest
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
branches:
- "*"
Expand All @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.22"
- name: Install dependencies
run: |
go get .
Expand All @@ -38,7 +38,7 @@ jobs:
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
thresholds: "60 80"
- uses: jwalton/gh-find-current-pr@v1
id: finder
- name: Add Coverage PR Comment
Expand Down Expand Up @@ -102,8 +102,8 @@ jobs:

checkcov:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status

runs-on: ubuntu-latest
steps:
Expand Down
80 changes: 33 additions & 47 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
---
version: "2"
run:
concurrency: 4
deadline: 2m
issues-exit-code: 1
tests: true

output:
formats: colored-line-number
print-issued-lines: true
print-linter-name: true

linters:
enable-all: false
disable-all: false
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- asciicheck
- bodyclose
- dogsled
Expand All @@ -33,9 +17,6 @@ linters:
- gocritic
- gocyclo
- godox
- gofmt
- gofumpt
- goimports
- gomodguard
- goprintffuncname
- gosec
Expand All @@ -53,7 +34,7 @@ linters:
- revive
- rowserrcheck
- sqlclosecheck
- stylecheck
- staticcheck
- testpackage
- thelper
- tparallel
Expand All @@ -62,30 +43,35 @@ linters:
- wastedassign
- whitespace
- wrapcheck
- wsl

linters-settings:
gocyclo:
min-complexity: 35

revive:
- wsl_v5
settings:
gocyclo:
min-complexity: 35
lll:
line-length: 120
revive:
rules:
- name: exported
disabled: true
exclusions:
generated: lax
rules:
- name: exported
disabled: true

lll:
line-length: 120

issues:
exclude-use-default: false
max-per-linter: 1024
max-same: 1024

exclude-rules:
# Exclude some linters from running on test files
- path: _test\.go
linters:
# bodyclose reports some false-positives when using a test request recorder
- bodyclose
# It's overkill to use `NewRequestWithContext` in tests
- noctx
- linters:
- bodyclose
- noctx
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$