ci: Added golangci linter
This commit is contained in:
26
.github/workflows/golang-lint.yml
vendored
Normal file
26
.github/workflows/golang-lint.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Lint Golang
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
golangci:
|
||||
name: lint
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: 1.25.0
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: v2.5.0
|
||||
args: '--config=${{ github.workspace }}/.golangci.yml'
|
||||
27
.golangci.yml
Normal file
27
.golangci.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
version: "2"
|
||||
|
||||
run:
|
||||
relative-path-mode: gomod
|
||||
timeout: 5m
|
||||
|
||||
linters:
|
||||
settings:
|
||||
dupl:
|
||||
threshold: 100
|
||||
enable:
|
||||
- errcheck
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- unused
|
||||
- errname
|
||||
- dupl
|
||||
- decorder
|
||||
- cyclop
|
||||
- funlen
|
||||
- lll
|
||||
- nestif
|
||||
- nlreturn
|
||||
- prealloc
|
||||
- tagalign
|
||||
- whitespace
|
||||
Reference in New Issue
Block a user