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
38 changes: 38 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: golangci-lint

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
schedule:
- cron: "23 6 * * 1"

permissions:
contents: read
pull-requests: read

jobs:
lint:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
path: common
# Sibling checkout (proto) — common itself is the repo under test, so
# only proto is fetched as a sibling for the replace directive.
- uses: actions/checkout@v4
with:
repository: InstaNode-dev/proto
path: proto
continue-on-error: true
- uses: actions/setup-go@v5
with:
go-version-file: common/go.mod
- uses: golangci/golangci-lint-action@v8
with:
version: latest
working-directory: common
args: --timeout=5m
31 changes: 31 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# golangci-lint v2 config — start conservative, expand once baseline is clean
version: "2"

run:
timeout: 5m
tests: true

linters:
# Default linter set is govet+errcheck+ineffassign+staticcheck+unused.
# We explicitly add misspell + gocyclo on top. gosimple folded into staticcheck in v2.
enable:
- errcheck # checks unchecked errors
- govet # standard vet
- ineffassign # ineffective assignments
- staticcheck # bug detection (subsumes gosimple in v2)
- unused # unused code
- misspell # spelling
- gocyclo # cyclomatic complexity
settings:
gocyclo:
min-complexity: 20
exclusions:
rules:
- path: _test\.go
linters:
- errcheck
- gocyclo

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