Skip to content

Commit 05b26ee

Browse files
authored
chore(ci): add lint def yaml (#114)
1 parent aa3e37c commit 05b26ee

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/test_and_lint.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ on:
33
paths:
44
- '**.go'
55
- 'go.mod'
6+
- '**.yml'
67
pull_request:
78
paths:
89
- '**.go'
910
- 'go.mod'
11+
- '**.yml'
1012

1113
name: Test & Lint
1214

@@ -39,7 +41,6 @@ jobs:
3941
- run: go generate ./...
4042
- name: Go vet
4143
run: go vet ./...
42-
4344
- name: GolangCI-Lint
4445
uses: golangci/golangci-lint-action@v6
4546
with:

.golangci.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
linters-settings:
2+
errcheck:
3+
ignore: fmt:.*,io/ioutil:^Read.*
4+
ignoretests: true
5+
6+
goimports:
7+
local-prefixes: github.com/LagrangeDev/LagrangeGo
8+
9+
linters:
10+
# please, do not use `enable-all`: it's deprecated and will be removed soon.
11+
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
12+
disable-all: true
13+
fast: false
14+
enable:
15+
- bodyclose
16+
#- depguard
17+
- dogsled
18+
- errcheck
19+
- exportloopref
20+
- exhaustive
21+
#- funlen
22+
#- goconst
23+
- gocritic
24+
#- gocyclo
25+
- gofmt
26+
- goimports
27+
- goprintffuncname
28+
#- gosec
29+
- gosimple
30+
- govet
31+
- ineffassign
32+
#- misspell
33+
- nolintlint
34+
- rowserrcheck
35+
- staticcheck
36+
- stylecheck
37+
- typecheck
38+
- unconvert
39+
- unparam
40+
- unused
41+
- whitespace
42+
- prealloc
43+
- predeclared
44+
- asciicheck
45+
- revive
46+
- forbidigo
47+
- makezero
48+
49+
50+
run:
51+
# default concurrency is a available CPU number.
52+
# concurrency: 4 # explicitly omit this value to fully utilize available resources.
53+
deadline: 5m
54+
issues-exit-code: 1
55+
tests: false
56+
go: '1.23'
57+
58+
# output configuration options
59+
output:
60+
formats:
61+
- format: "colored-line-number"
62+
print-issued-lines: true
63+
print-linter-name: true
64+
uniq-by-line: true
65+
66+
issues:
67+
# Fix found issues (if it's supported by the linter)
68+
fix: true

0 commit comments

Comments
 (0)