Skip to content

Commit afaf300

Browse files
author
Dylan Trotter
committed
Implement make precommit action that includes cover, lint and test.
1 parent f15e8e5 commit afaf300

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ run: $(RUNNER)
7878

7979
test: $(ACCEPT_PASS_FILES) $(COMPILER_PASS_FILES) $(COMPILER_EXPR_VISITOR_PASS_FILES) $(COMPILER_STMT_PASS_FILES) $(RUNTIME_PASS_FILE) $(STDLIB_PASS_FILES)
8080

81-
.PHONY: all benchmarks clean cover lint run test
81+
precommit: cover lint test
82+
83+
.PHONY: all benchmarks clean cover lint precommit run test
8284

8385
# ------------------------------------------------------------------------------
8486
# grumpc compiler
@@ -136,12 +138,13 @@ $(RUNTIME_COVER_FILE): $(RUNTIME) $(filter %_test.go,$(RUNTIME_SRCS))
136138

137139
cover: $(RUNTIME_COVER_FILE) $(TOOL_BINS)
138140
@bash -c 'comm -12 <(coverparse $< | sed "s/^grumpy/runtime/" | sort) <(git diff --dst-prefix= $(DIFF_COMMIT) | diffrange | sort)' | sort -t':' -k1,1 -k2n,2 | sed 's/$$/: missing coverage/' | tee errors.err
141+
@test ! -s errors.err
139142

140143
$(GOLINT_BIN):
141144
@go get -u github.com/golang/lint/golint
142145

143146
lint: $(GOLINT_BIN)
144-
@$(GOLINT_BIN) runtime
147+
@$(GOLINT_BIN) -set_exit_status runtime
145148

146149
# ------------------------------------------------------------------------------
147150
# Standard library

0 commit comments

Comments
 (0)