Sophie

Sophie

distrib > Mandriva > 2007.1 > i586 > by-pkgid > 3adcbbe8f530d311054935ce76dcf70f > files > 1

rpmlint-0.77-3mdv2007.0.src.rpm

Index: trunk/SpecCheck.py
===================================================================
--- trunk/SpecCheck.py (revision 1203)
+++ trunk/SpecCheck.py (revision 1205)
@@ -67,4 +67,7 @@
 depgen_disable_regex = re.compile('(^|\s)%(define|global)\s+_use_internal_dependency_generator\s+0')
 
+indent_spaces_regex = re.compile(' {3}.*\S')
+indent_tabs_regex = re.compile('\t.*\S')
+
 def file2string(file):
     fd = open(file, "r")
@@ -113,4 +116,6 @@
             depscript_override = 0
             depgen_disabled = 0
+            indent_spaces = 0
+            indent_tabs = 0
 
             if use_utf8 and not is_utf8(spec_file):
@@ -246,4 +251,9 @@
                         depgen_disabled = depgen_disable_regex.search(line)
 
+                if not indent_tabs and indent_tabs_regex.search(line):
+                    indent_tabs = 1
+                if not indent_spaces and indent_spaces_regex.search(line):
+                    indent_spaces = 1
+
             if 0 in buildroot_clean.values():
                 printError(pkg, 'no-cleaning-of-buildroot')
@@ -260,4 +270,7 @@
             if depscript_override and not depgen_disabled:
                 printWarning(pkg, 'depscript-without-disabling-depgen')
+
+            if indent_spaces and indent_tabs:
+                printWarning(pkg, 'mixed-use-of-spaces-and-tabs')
 
             # process gathered info
@@ -389,4 +402,8 @@
 been disabled for the build.  %define _use_internal_dependency_generator to 0
 to disable it in the specfile, or don't define __find_provides/requires.''',
+
+'mixed-use-of-spaces-and-tabs',
+'''The specfile mixes use of spaces and tabs for indentation, which is a
+cosmetic annoyance.  Use either spaces or tabs for indentation, not both.''',
 )