Skip to content

Commit eedc693

Browse files
committed
chore: add formatting check to gh actions
1 parent b2f05bc commit eedc693

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ jobs:
2222
with:
2323
go-version: 1.23
2424

25+
- name: Check formatting
26+
run: make check-fmt
27+
2528
- name: Test
2629
run: make

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,13 @@ test:
88
build:
99
go build main.go
1010

11+
.PHONE: check-fmt
12+
check-fmt:
13+
unformatted=$$(gofmt -l .); \
14+
if [ -n "$$unformatted" ]; then \
15+
echo "The following files are not formatted properly:"; \
16+
echo "$$unformatted"; \
17+
exit 1; \
18+
fi
19+
1120
.DEFAULT_GOAL := test

0 commit comments

Comments
 (0)