[Libvir] [PATCH 3/4] Ensure that no C source file uses TABs for indentation

Ensure that no C source file uses TABs for indentation. * Makefile.maint (sc_TAB_in_indentation): New rule. diff --git a/Makefile.maint b/Makefile.maint index a357d74..4e41134 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -287,6 +287,17 @@ sc_trailing_blank: { echo '$(ME): found trailing blank(s)' \ 1>&2; exit 1; } || : +# Ensure that no C source file uses TABs for indentation. +# Also match *.h.in files, to get libvirt.h.in. +# Exclude files in gnulib, since they're imported. +sc_TAB_in_indentation: + @grep -lE '^ * ' /dev/null \ + $$($(VC_LIST_EXCEPT) \ + | grep -E '\.[ch](\.in)?$$' \ + | grep -v '^gnulib/') && \ + { echo '$(ME): found TAB(s) use for indentation; use spaces' \ + 1>&2; exit 1; } || : + # Match lines like the following, but where there is only one space # between the options and the description: # -D, --all-repeated[=delimit-method] print all duplicate lines\n -- 1.5.5.24.g3cff

On Thu, Apr 10, 2008 at 05:45:19PM +0200, Jim Meyering wrote: +1 but shame that egrep doesn't support some notion of \t for tab or the like:
+ @grep -lE '^ * ' /dev/null \
Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

"Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, Apr 10, 2008 at 05:45:19PM +0200, Jim Meyering wrote:
+1 but shame that egrep doesn't support some notion of \t for tab or the like:
+ @grep -lE '^ * ' /dev/null \
Yeah, that's annoying. It makes me want to use Perl sometimes. However, GNU grep does have a --perl-regexp (-P) option, so this would work, $ printf 'x\t'|grep -P '\t' x but it's not portable enough. Even among systems with recent GNU grep, some compile it out, e.g. Debian's grep says this: grep: Support for the -P option is not compiled into this --disable-perl-regexp binary

On Thu, Apr 10, 2008 at 05:45:19PM +0200, Jim Meyering wrote:
Ensure that no C source file uses TABs for indentation. * Makefile.maint (sc_TAB_in_indentation): New rule.
Hopefully that won't break all the time, it may get painful, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel Veillard
-
Jim Meyering
-
Richard W.M. Jones