public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [RFC PATCH] coccicheck: fail "make" when it fails
@ 2025-06-19 15:35 Junio C Hamano
  2025-06-21  5:16 ` Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Junio C Hamano @ 2025-06-19 15:35 UTC (permalink / raw)
  To: git

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 <gitster@pobox•com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git c/Makefile w/Makefile
index 70d1543b6b..2c17868a24 100644
--- c/Makefile
+++ w/Makefile
@@ -3475,8 +3475,10 @@ coccicheck-test: $(COCCI_TEST_RES_GEN)
 coccicheck: coccicheck-test
 ifdef SPATCH_CONCAT_COCCI
 coccicheck: contrib/coccinelle/ALL.cocci.patch
+	! test -s contrib/coccinelle/ALL.cocci.patch
 else
 coccicheck: $(COCCICHECK_PATCHES_INTREE)
+	test $$(cat $(COCCICHECK_PATCHES_INTREE) | wc -c) = 0
 endif
 
 # See contrib/coccinelle/README

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-23 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 15:35 [RFC PATCH] coccicheck: fail "make" when it fails Junio C Hamano
2025-06-21  5:16 ` Jeff King
2025-06-21  6:29 ` Carlo Marcelo Arenas Belón
2025-06-21  8:09   ` Eric Sunshine
2025-06-22  4:18     ` Junio C Hamano
2025-06-23 16:14 ` [PATCH v2] " Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox