Skip to content

Commit

Permalink
ci: Introduce format check (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Nov 28, 2024
1 parent 164b47f commit 7d168b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
version: latest

- name: Format check
run: go fmt ./...
run: make fmt-check

- name: Static analysis
run: go vet ./...
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: audit build lint lintfix run
.PHONY: audit build lint lintfix fmt fmt-check run test test-verbose test-coverage

check: lint
go fmt ./...
Expand All @@ -13,6 +13,15 @@ lint:
lintfix:
golangci-lint run --fix

fmt:
go fmt ./...

fmt-check:
@if [ -n "$$(go fmt ./...)" ]; then \
echo "Found unformatted Go files. Please run 'make fmt'"; \
exit 1; \
fi

run: build
./bin/main javascript

Expand Down

0 comments on commit 7d168b9

Please sign in to comment.