Skip to content

Commit c94fa51

Browse files
authoredMay 11, 2023
Updated formatting (#82)
* run goimports * run golangci-lint * add lint test * run imports prior to building * install goimports inside container * run goimports * cleanup
1 parent 84c4425 commit c94fa51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+272
-245
lines changed
 

‎.github/workflows/lint.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lint
2+
3+
env:
4+
GO_VERSION: '1.20.4'
5+
LINTER_VERSION: 'v1.52.2'
6+
7+
on: push
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/setup-go@v3
14+
with:
15+
go-version: ${{ env.GO_VERSION }}
16+
- uses: actions/checkout@v2
17+
- name: Cache Vendor
18+
uses: actions/cache@v2
19+
env:
20+
cache-name: cache-vendor-v1
21+
with:
22+
path: vendor
23+
key: ${{ env.cache-name }}-${{ env.GO_VERSION }}-${{ hashFiles('go.mod') }}-${{ hashFiles('go.sum') }}
24+
restore-keys: |
25+
${{ env.cache-name }}-${{ env.GO_VERSION }}-
26+
${{ env.cache-name }}-
27+
28+
- name: Populate Vendor
29+
shell: bash
30+
run: |
31+
make vendor
32+
33+
- shell: bash
34+
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@${{ env.LINTER_VERSION }}
35+
36+
- shell: bash
37+
run: golangci-lint run --out-format=github-actions

‎Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ FROM golang:1.20.4-buster as intermediate
88
# Make a directory to place pprof files in. Typically used for itests.
99
RUN mkdir /perf
1010

11-
# Build dependencies
11+
# Build/test dependencies
1212
RUN go install github.com/golang/mock/mockgen@v1.6.0
13+
RUN go install golang.org/x/tools/cmd/goimports@latest
1314

1415
WORKDIR /go/src/github.com/Nextdoor/pg-bifrost.git/
1516

0 commit comments

Comments
 (0)
Please sign in to comment.