Skip to content

Commit cfe9add

Browse files
committed
Add lint to CI
It is necessary to remember not to bring the code to a state complying with the rules.
1 parent f5f4e2c commit cfe9add

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

.github/workflows/go.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,17 @@ jobs:
3333

3434
- name: Teardown test environment
3535
run: make test-env-up
36+
37+
golangci:
38+
name: lint
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
- uses: actions/setup-go@v4
43+
with:
44+
go-version: '1.20'
45+
cache: false
46+
- name: golangci-lint
47+
uses: golangci/golangci-lint-action@v3
48+
with:
49+
version: v1.53

.golangci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
- errcheck
5+
- godot
6+
- goimports
7+
- gosimple
8+
- govet
9+
- ineffassign
10+
- misspell
11+
- staticcheck
12+
- typecheck
13+
- unused
14+
- whitespace

Makefile

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,7 @@ test-env-down: ## Down and cleanup test environment.
2828

2929
.PHONY: lint
3030
lint: tools ## Check the project with lint.
31-
@golangci-lint run \
32-
--fix \
33-
--disable-all \
34-
-E errcheck \
35-
-E godot \
36-
-E goimports \
37-
-E gosimple \
38-
-E govet \
39-
-E ineffassign \
40-
-E misspell \
41-
-E staticcheck \
42-
-E typecheck \
43-
-E unused \
44-
-E whitespace \
45-
./...
31+
@golangci-lint run --fix ./...
4632

4733
tools: ## Install all needed tools, e.g.
4834
@go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2

0 commit comments

Comments
 (0)