Skip to content

Commit 3d82281

Browse files
committed
add golangci-lint
1 parent d667761 commit 3d82281

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@ on:
1010
paths-ignore:
1111
- '*.md'
1212
- 'website/*'
13+
permissions:
14+
contents: read
15+
pull-requests: read
1316
jobs:
17+
golangci:
18+
name: lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: golangci-lint
23+
uses: golangci/golangci-lint-action@v2
24+
with:
25+
version: v1.43.0
26+
only-new-issues: true
1427
build:
1528
name: Build
1629
runs-on: ${{ matrix.os }}

.golangci.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
linters-settings:
2+
lll:
3+
line-length: 140
4+
gosec:
5+
# complains that we allow to bypass checking certificates/keys
6+
excludes:
7+
- G402
8+
- G106
9+
10+
linters:
11+
enable-all: false
12+
enable:
13+
- ifshort
14+
- unparam
15+
- exhaustive
16+
- godot
17+
- nilerr
18+
- gosec
19+
- revive
20+
- gocritic
21+
- misspell
22+
- depguard
23+
- lll
24+
- errorlint
25+
- errcheck
26+
issues:
27+
new-from-rev: HEAD~

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ install:
2020
test:
2121
go test -v $(TEST_ARGS_DEF) $(TEST_ARGS) ./libvirt
2222

23+
lint:
24+
golangci-lint run
25+
terraform fmt -write=false -check=true -diff=true examples/
26+
2327
# acceptance tests
2428
# usage:
2529
#

0 commit comments

Comments
 (0)