Skip to content

Commit 9123118

Browse files
chore: enable golangci-lint (#103)
* chore: enable golangci-lint * chore: free up runner disk space
1 parent 928e855 commit 9123118

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/pull-request.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
- name: Go vet
1616
run: |
1717
make vet
18+
- name: Lint
19+
uses: golangci/golangci-lint-action@v3
20+
with:
21+
version: v1.54
1822
tests:
1923
name: Unit tests
2024
runs-on: ubuntu-latest
@@ -49,6 +53,11 @@ jobs:
4953
sudo df -h
5054
- name: Checkout
5155
uses: actions/checkout@v4
56+
- name: Free up runner disk space
57+
run: |
58+
sudo rm -rf /usr/local/lib/android
59+
sudo rm -rf /opt/hostedtoolcache/CodeQL
60+
sudo rm -rf /opt/hostedtoolcache/Python
5261
- name: Get short commit hash
5362
run: echo "SHORT_SHA=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
5463
- name: Setup Go

.golangci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
run:
2+
timeout: 10m
3+
4+
output:
5+
# Make output more digestible with quickfix in vim/emacs/etc.
6+
sort-results: true
7+
print-issued-lines: false
8+
9+
linters:
10+
# We'll track the golangci-lint default linters manually
11+
# instead of letting them change without our control.
12+
disable-all: true
13+
enable:
14+
# golangci-lint defaults:
15+
# - errcheck
16+
- gosimple
17+
- govet
18+
- ineffassign
19+
- staticcheck
20+
# - unused
21+
22+
# Our own extras:
23+
- gofmt
24+
- nolintlint # lints nolint directives
25+
# - revive
26+
27+
linters-settings:
28+
govet:
29+
# These govet checks are disabled by default, but they're useful.
30+
enable:
31+
- nilness
32+
- reflectvaluecompare
33+
- sortslice
34+
- unusedwrite
35+
36+
issues:
37+
# Print all issues reported by all linters.
38+
max-issues-per-linter: 0
39+
max-same-issues: 0
40+
41+
# Don't ignore some of the issues that golangci-lint considers okay.
42+
# This includes documenting all exported entities.
43+
exclude-use-default: false

0 commit comments

Comments
 (0)