Skip to content

Commit b776c00

Browse files
authored
Add golangci-lint as a dependency (#86)
1 parent e1e3739 commit b776c00

File tree

6 files changed

+1287
-11
lines changed

6 files changed

+1287
-11
lines changed

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'examples/**'
9+
- '**.md'
10+
types:
11+
- opened
12+
- reopened
13+
- synchronize
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
env:
20+
GOLANGCI_TIMEOUT: 10m0s
21+
22+
jobs:
23+
24+
lint:
25+
name: Lint
26+
runs-on: ubuntu-20.04
27+
steps:
28+
- name: Checkout Repository
29+
uses: actions/checkout@v2
30+
- name: Lint Code
31+
uses: golangci/golangci-lint-action@v2.5.2
32+
with:
33+
args: --timeout ${{ env.GOLANGCI_TIMEOUT }}

.golangci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
linters-settings:
2+
misspell:
3+
locale: US
4+
5+
linters:
6+
enable:
7+
- goimports
8+
- gosimple
9+
- govet
10+
- misspell
11+
- gofmt
12+
- unparam
13+
- unconvert
14+
- structcheck
15+
- errcheck
16+
disable-all: true
17+

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ all: amazon amazon2 centos7 centos8 debian
88
test:
99
GO111MODULE=on go test ./...
1010

11+
.PHONY: lint
1112
lint:
12-
golangci-lint run
13+
go run github.com/golangci/golangci-lint/cmd/golangci-lint run
1314

1415
.PHONY: build
1516
build:

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
99
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
1010
github.com/aws/aws-sdk-go v1.38.14
11+
github.com/golangci/golangci-lint v1.39.0
1112
github.com/nginxinc/nginx-plus-go-client v0.8.0
1213
gopkg.in/yaml.v2 v2.4.0
1314
)

0 commit comments

Comments
 (0)