Skip to content

Add golangci-lint as a dependency #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint

on:
pull_request:
branches:
- master
paths-ignore:
- 'examples/**'
- '**.md'
types:
- opened
- reopened
- synchronize

defaults:
run:
shell: bash

env:
GOLANGCI_TIMEOUT: 10m0s

jobs:

lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Lint Code
uses: golangci/golangci-lint-action@v2.5.2
with:
args: --timeout ${{ env.GOLANGCI_TIMEOUT }}
17 changes: 17 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
linters-settings:
misspell:
locale: US

linters:
enable:
- goimports
- gosimple
- govet
- misspell
- gofmt
- unparam
- unconvert
- structcheck
- errcheck
disable-all: true

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ all: amazon amazon2 centos7 centos8 debian
test:
GO111MODULE=on go test ./...

.PHONY: lint
lint:
golangci-lint run
go run github.com/golangci/golangci-lint/cmd/golangci-lint run

.PHONY: build
build:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/aws/aws-sdk-go v1.38.14
github.com/golangci/golangci-lint v1.39.0
github.com/nginxinc/nginx-plus-go-client v0.8.0
gopkg.in/yaml.v2 v2.4.0
)
Loading