Bruno Haible via Gnulib discussion list <[email protected]> writes:

> Zack Weinberg wrote:
>> The ‘makefile_TAB_only_indentation’ syntax check objects to some of the
>> whitespace in maint.mk.  Fix attached.
>
> No, I object to this patch. Gnulib uses spaces-only indentation for most of
> its files, and 1-level-of-tab for Makefiles, for the sake/benefit of AIX
> 'make'. We have abandoned the tab-only or multiple-tabs-then-spaces
> indentation because it makes editing generally harder, since 2009.

I also think this style is nicer.

> Instead, you can probably customize this syntax check in your cfg.mk
> so that it does not apply to maint.mk, I guess?

That is one workaround.  But should we really have the
sc_makefile_TAB_only_indentation check in gnulib?

sc_makefile_TAB_only_indentation:
        @prohibit='^    [ ]{8}'                                         \
        in_vc_files='akefile|\.mk$$'                                    \
        halt='found TAB-8-space indentation'                            \
          $(_sc_search_regexp)

I think this warns for a style we prefer, which seems odd.

I can think of two improvements:

1) Have sc_makefile_TAB_only_indentation not complaint for maint.mk by
default.

2) Add a new syntax-check rule that looks for two TAB in makefile, to
actually identify identation we don't like.  See attached patch.  Does
someone object to this?  Support?

Possibly sc_makefile_TAB_only_indentation could be removed, but since
nobody has noticed it until now, maybe it actually serve some purpose
and the cost to deal with exceptions has largely already been paid.

/Simon
From 952a18fd33a749aa9508322a3f2907a925d4e603 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <[email protected]>
Date: Tue, 3 Feb 2026 18:23:23 +0100
Subject: [PATCH] maintainer-makefile: Make syntax-check warn for TABTAB in
 makefiles

* top/maint.mk: Add sc_makefile_TAB_TAB_indentation.
---
 top/maint.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/top/maint.mk b/top/maint.mk
index 29318a76c1..ca9c38c0df 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1327,6 +1327,12 @@ sc_makefile_TAB_only_indentation:
 	halt='found TAB-8-space indentation'				\
 	  $(_sc_search_regexp)
 
+sc_makefile_TAB_TAB_indentation:
+	@prohibit='^		'					\
+	in_vc_files='akefile|\.mk$$'					\
+	halt='found TAB-TAB indentation, change to TAB-SPC*'		\
+	  $(_sc_search_regexp)
+
 sc_m4_quote_check:
 	@prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]'		\
 	in_vc_files='(^configure\.ac|\.m4)$$'				\
-- 
2.52.0

Attachment: signature.asc
Description: PGP signature

Reply via email to