Skip to content

Commit 4f67116

Browse files
dev(dx): lint improvements
1 parent 30fdafc commit 4f67116

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ jobs:
3737
- name: Build
3838
run: make build
3939

40-
- name: Lint
41-
uses: golangci/golangci-lint-action@v1
42-
with:
43-
# Required: the version of golangci-lint is required and must be specified
44-
# without patch version: we always use the latest patch version.
45-
version: v1.27
46-
4740
- name: Test
4841
run: make test
4942

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
pull_request:
9+
jobs:
10+
golangci:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: golangci-lint
16+
uses: golangci/golangci-lint-action@v1
17+
with:
18+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
19+
version: v1.29
20+
21+
# Optional: golangci-lint command line arguments.
22+
args: --timeout 5m

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ SOURCES := $(shell find . -name '*.go' -not -path "*/vendor/*" -not -pa
88
build: $(SOURCES) ## Build Test
99
go build -i -ldflags="-s -w" ./...
1010

11-
lint: golangci-lint ## Run golint
11+
lint: golangci-lint ## Run golangci-lint
1212
@$(GOLANGCI_LINT) run
1313

14+
lint-fix: golangci-lint ## Run golangci lint to automatically perform fixes
15+
@$(GOLANGCI_LINT) run --fix
16+
1417
fmt: ## Run go fmt
1518
@gofmt -d $(SOURCES)
1619

@@ -39,7 +42,7 @@ golangci-lint:
3942
ifeq (, $(shell which golangci-lint))
4043
@{ \
4144
set -e ;\
42-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.27.0 ;\
45+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.29.0 ;\
4346
}
4447
GOLANGCI_LINT=$(shell go env GOPATH)/bin/golangci-lint
4548
else

0 commit comments

Comments
 (0)