Skip to content

Commit 5c84e37

Browse files
authored
build: add pr checks workflow (#9)
1 parent b9315ff commit 5c84e37

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- canary
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
golangci-lint:
13+
name: golangci-lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.25.4'
23+
24+
- name: Run golangci-lint
25+
uses: golangci/golangci-lint-action@v7
26+
with:
27+
version: latest

.golangci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: "2"
2+
3+
linters:
4+
default: standard
5+
enable:
6+
- gocritic
7+
- revive
8+
- misspell
9+
- unconvert
10+
- unparam
11+
- errorlint
12+
settings:
13+
errcheck:
14+
check-type-assertions: true
15+
govet:
16+
enable-all: true
17+
disable:
18+
- fieldalignment
19+
gocritic:
20+
enabled-tags:
21+
- diagnostic
22+
- style
23+
- performance
24+
revive:
25+
rules:
26+
- name: blank-imports
27+
- name: exported
28+
- name: unreachable-code
29+
- name: unused-parameter
30+
exclusions:
31+
presets:
32+
- std-error-handling
33+
rules:
34+
- path: '(.+)_test\.go'
35+
linters:
36+
- errcheck
37+
- text: 'unused-parameter'
38+
source: 'cobra\.Command'

0 commit comments

Comments
 (0)