Skip to content

Commit 8656ab6

Browse files
justinsbthockin
authored andcommitted
lint: Add linters to makefile / github CI
Not yet ready to make gating, but we can watch the progress.
1 parent d86e70f commit 8656ab6

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,30 @@ jobs:
4646
working-directory: git-sync
4747
run: |
4848
make test
49+
50+
lint:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Set up go
54+
uses: actions/setup-go@v4
55+
with:
56+
go-version: '1.20.6'
57+
58+
- uses: actions/checkout@v3
59+
with:
60+
path: git-sync
61+
62+
# We run the github action, even though this is duplicated in `make lint` below.
63+
# This is because the action gives easier-to-read output than the linter.
64+
# There is a risk of drift between the two, but this is only linting,
65+
# not runtime correctness!
66+
- name: golangci-lint
67+
uses: golangci/golangci-lint-action@v3
68+
with:
69+
working-directory: git-sync
70+
version: v1.53.3
71+
72+
- name: make lint
73+
working-directory: git-sync
74+
run: |
75+
make lint

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,11 @@ container-clean:
276276

277277
bin-clean:
278278
rm -rf .go bin
279+
280+
lint-staticcheck:
281+
go run honnef.co/go/tools/cmd/staticcheck@2023.1.3
282+
283+
lint-golangci-lint:
284+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 run
285+
286+
lint: lint-staticcheck lint-golangci-lint

0 commit comments

Comments
 (0)