Skip to content

Commit 3c3de55

Browse files
authored
Merge pull request #90 from boombuler/golangci-lint
Use golangci-lint to enforce linting and formatting rules
2 parents 5d53508 + c3c8723 commit 3c3de55

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
golangci:
15+
name: lint
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version: stable
24+
25+
- name: golangci-lint
26+
uses: golangci/golangci-lint-action@v8
27+
with:
28+
version: v2.1
29+
# Show only new issues until the entire repository
30+
# is compliant with the new linting rules.
31+
only-new-issues: true

.golangci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configuration of formatting and linting using https://golangci-lint.run/.
2+
version: "2"
3+
4+
linters:
5+
default: none
6+
enable:
7+
- errcheck
8+
- govet
9+
- ineffassign
10+
- staticcheck
11+
- unused
12+
13+
formatters:
14+
enable:
15+
- gofmt
16+
- goimports
17+
18+
issues:
19+
# Show only new issues created after the introduction of the linter.
20+
new-from-rev: ea5ac7e13561f6334938261321e13a725d1c0180
21+
22+
# Show issues in any part of update files (requires new-from-rev or new-from-patch).
23+
whole-files: true

0 commit comments

Comments
 (0)