]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: detect/prohibit hardcoded XML indent in syntax-check
authorLaine Stump <laine@laine.org>
Thu, 13 Mar 2014 00:05:31 +0000 (18:05 -0600)
committerLaine Stump <laine@laine.org>
Fri, 14 Mar 2014 06:02:43 +0000 (00:02 -0600)
This rule wouldn't be able to find any case of a hardcoded indent that
was in the middle of a string, but then virBuffer doesn't add
indentation in the middle of a string either.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 9ad8cf75292af310e30019615b536424a7d95a96..f52295982c4964857b064b6bcf4516b1ccebee86 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,5 +1,5 @@
 # Customize Makefile.maint.                           -*- makefile -*-
-# Copyright (C) 2008-2013 Red Hat, Inc.
+# Copyright (C) 2008-2014 Red Hat, Inc.
 # Copyright (C) 2003-2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
@@ -517,6 +517,11 @@ sc_prohibit_virBufferAsprintf_with_string_literal:
        halt='use virBufferAddLit, not virBufferAsprintf, with a string literal' \
          $(_sc_search_regexp)
 
+sc_forbid_manual_xml_indent:
+       @prohibit='virBuffer.*" +<'                                           \
+       halt='use virBufferAdjustIndent instead of spaces when indenting xml' \
+         $(_sc_search_regexp)
+
 # Not only do they fail to deal well with ipv6, but the gethostby*
 # functions are also not thread-safe.
 sc_prohibit_gethostby: