Skip to content
Merged
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
44 changes: 29 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
name: lint
on:
pull_request:
push:
branches: [ main ]
pull_request:
push:
branches: [main]

jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=5m
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=5m

staticlint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dependencies
run: go mod tidy
- name: Run Staticlint
run: go run ./cmd/staticlint/main.go ./...
147 changes: 72 additions & 75 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,81 @@
version: "2"

run:
timeout: 5m
tests: true
concurrency: 0
timeout: 5m
tests: true
concurrency: 0

linters:
default: none
enable:
- govet
- staticcheck
- errcheck
- ineffassign
- unused
- revive
- gocyclo
- dupl
- goconst
- gocritic
- misspell
- prealloc
- copyloopvar
- nakedret
- unparam
- gosec
- noctx
- sqlclosecheck
- nolintlint
settings:
gocyclo:
min-complexity: 15
dupl:
threshold: 150
goconst:
min-len: 2
min-occurrences: 3
misspell:
locale: US
gocritic:
enabled-checks:
- rangeValCopy
- appendCombine
- captLocal
- ifElseChain
- sloppyLen
nolintlint:
require-explanation: true
require-specific: true
revive:
rules:
- name: exported
disabled: false
exclusions:
paths:
- vendor
- third_party
- gen
- generated
- ".*_generated\\.go"
- ".*\\.pb\\.go"
- ".*_mock\\.go"
rules:
- path: '(.+)_test\.go'
linters:
- unparam
- gocyclo
- dupl
- gosec
- linters: [errcheck]
text: "Error return value of .*\\.(Close|Stop)\\(\\) is not checked"
- text: "context.WithCancel function results are not used"
source: "context\\.WithCancel\\("
default: none
enable:
- govet
- staticcheck
- errcheck
- ineffassign
- unused
- revive
- gocyclo
- dupl
- goconst
- gocritic
- misspell
- prealloc
- copyloopvar
- nakedret
- unparam
- gosec
- noctx
- sqlclosecheck
- nolintlint
settings:
gocyclo:
min-complexity: 15
dupl:
threshold: 150
goconst:
min-len: 2
min-occurrences: 3
misspell:
locale: US
gocritic:
enabled-checks:
- rangeValCopy
- appendCombine
nolintlint:
require-explanation: true
require-specific: true
revive:
rules:
- name: exported
disabled: false
exclusions:
paths:
- vendor
- third_party
- gen
- generated
- ".*_generated\\.go"
- ".*\\.pb\\.go"
- ".*_mock\\.go"
rules:
- path: '(.+)_test\.go'
linters:
- unparam
- gocyclo
- dupl
- gosec
- linters: [errcheck]
text: "Error return value of .*\\.(Close|Stop)\\(\\) is not checked"
- text: "context.WithCancel function results are not used"
source: "context\\.WithCancel\\("

issues:
max-issues-per-linter: 0
max-same-issues: 0
max-issues-per-linter: 0
max-same-issues: 0

formatters:
enable:
- gofumpt
settings:
gofumpt:
extra-rules: true
enable:
- gofumpt
settings:
gofumpt:
extra-rules: true
Loading