Skip to content

Commit 819d3a5

Browse files
committed
coccicheck: fail "make" when it fails
With "make coccicheck", we generate contrib/coccinelle/*.cocci.patch files that contain changes suggested by semantic patches, but "make" succeeds. Admittedly, not many developers may run "make coccicheck" in the first place, but it makes it harder to notice when they do run it after they introduced an iffy piece of code. Check that the resulting cocci.patch files are all empty. Signed-off-by: Junio C Hamano <[email protected]>
1 parent f93ff17 commit 819d3a5

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
@@ -3422,11 +3422,14 @@ endif
34223422
coccicheck-test: $(COCCI_TEST_RES_GEN)
34233423

34243424
coccicheck: coccicheck-test
3425+
34253426
ifdef SPATCH_CONCAT_COCCI
3426-
coccicheck: contrib/coccinelle/ALL.cocci.patch
3427+
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = contrib/coccinelle/ALL.cocci.patch
34273428
else
3428-
coccicheck: $(COCCICHECK_PATCHES_INTREE)
3429+
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = $(COCCICHECK_PATCHES_INTREE)
34293430
endif
3431+
coccicheck: $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES)
3432+
! grep -q ^ $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES) /dev/null
34303433

34313434
# See contrib/coccinelle/README
34323435
coccicheck-pending: coccicheck-test

0 commit comments

Comments
 (0)