-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (33 loc) · 953 Bytes
/
linting.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Go Lint and Format Check
on:
pull_request:
jobs:
lint_and_format:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.6'
- name: Install Tools
run: |
go install mvdan.cc/gofumpt@latest
go install github.com/segmentio/golines@latest
- name: Run gofumpt
run: |
gofumpt -d . | tee gofumpt_output.txt
if [ -s gofumpt_output.txt ]; then
echo "gofumpt found issues:"
cat gofumpt_output.txt
exit 1
fi
- name: Run golines
run: |
golines --max-len=160 . --dry-run | tee golines_output.txt
if [ -s golines_output.txt ]; then
echo "golines found lines exceeding 140 characters:"
cat golines_output.txt
exit 1
fi