mirror of https://github.com/jetkvm/kvm.git
Chore: Enable golangci-lint
Add a GitHub actions workflow to run golangci-lint. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
c380c702c7
commit
dd1189e8ad
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
name: golangci-lint
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "go.sum"
|
||||||
|
- "go.mod"
|
||||||
|
- "**.go"
|
||||||
|
- ".github/workflows/golangci-lint.yml"
|
||||||
|
- ".golangci.yml"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
permissions: # added using https://github.com/step-security/secure-repo
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
golangci:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
|
||||||
|
name: lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
|
||||||
|
with:
|
||||||
|
go-version: 1.23.x
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
|
||||||
|
with:
|
||||||
|
args: --verbose
|
||||||
|
version: v1.62.0
|
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
# - goimports
|
||||||
|
# - misspell
|
||||||
|
# - revive
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
- path: _test.go
|
||||||
|
linters:
|
||||||
|
- errcheck
|
Loading…
Reference in New Issue