Skip to content

Commit 63d9cb4

Browse files
committed
Add linter workflow
1 parent 4924153 commit 63d9cb4

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: lint
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
golangci:
8+
name: lint
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: golangci-lint
13+
uses: golangci/golangci-lint-action@v2
14+
with:
15+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
16+
version: v1.31
17+
# Optional: golangci-lint command line arguments.
18+
args: --issues-exit-code=0
19+
# Optional: working directory, useful for monorepos
20+
# working-directory: somedir
21+
# Optional: show only new issues if it's a pull request. The default value is `false`.
22+
only-new-issues: true

.golangci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
run:
2+
tests: false
3+
4+
issues:
5+
max-issues-per-linter: 0
6+
max-same-issues: 0
7+
8+
linters:
9+
enable:
10+
- bodyclose
11+
- dupl
12+
- exportloopref
13+
- goconst
14+
- godot
15+
- godox
16+
- goimports
17+
- goprintffuncname
18+
- gosec
19+
- misspell
20+
- prealloc
21+
- rowserrcheck
22+
- sqlclosecheck
23+
- unconvert
24+
- unparam
25+
- whitespace

0 commit comments

Comments
 (0)