Rev 4309: (Marius Kruger) Don't raise KnownFailure for all coding style in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Apr 28 18:05:43 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4309
revision-id: pqm at pqm.ubuntu.com-20090428170537-tbjh8ng5lrws1er9
parent: pqm at pqm.ubuntu.com-20090428154741-aeenq3dwmxc5afln
parent: amanic at gmail.com-20090328101014-tn2kltxa6e9asrwo
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-04-28 18:05:37 +0100
message:
  (Marius Kruger) Don't raise KnownFailure for all coding style
  	regressions.
modified:
  bzrlib/tests/test_source.py    test_source.py-20051207061333-a58dea6abecc030d
  doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
    ------------------------------------------------------------
    revno: 4210.5.2
    revision-id: amanic at gmail.com-20090328101014-tn2kltxa6e9asrwo
    parent: amanic at gmail.com-20090328095723-9dlx06tj3jc3elgk
    committer: Marius Kruger <amanic at gmail.com>
    branch nick: bzr.remove_trailing_whitespace
    timestamp: Sat 2009-03-28 12:10:14 +0200
    message:
      update white space policy in HACKING
    modified:
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
    ------------------------------------------------------------
    revno: 4210.5.1
    revision-id: amanic at gmail.com-20090328095723-9dlx06tj3jc3elgk
    parent: pqm at pqm.ubuntu.com-20090327165538-lustxviiwnrfg2u2
    committer: Marius Kruger <amanic at gmail.com>
    branch nick: bzr.remove_trailing_whitespace
    timestamp: Sat 2009-03-28 11:57:23 +0200
    message:
      don't raise KnownFailure for all coding_style regressions, 
      and only note the number of files with trailing white-space in stead of failing.
    modified:
      bzrlib/tests/test_source.py    test_source.py-20051207061333-a58dea6abecc030d
=== modified file 'bzrlib/tests/test_source.py'
--- a/bzrlib/tests/test_source.py	2009-03-24 20:04:57 +0000
+++ b/bzrlib/tests/test_source.py	2009-03-28 09:57:23 +0000
@@ -35,7 +35,6 @@
     )
 import bzrlib.branch
 from bzrlib.tests import (
-    KnownFailure,
     TestCase,
     TestSkipped,
     )
@@ -284,13 +283,14 @@
     def test_coding_style(self):
         """Check if bazaar code conforms to some coding style conventions.
 
-        Currently we check for:
+        Currently we assert that the following is not present:
          * any tab characters
-         * trailing white space
          * non-unix newlines
          * no newline at end of files
+
+        Print how many files have
+         * trailing white space
          * lines longer than 79 chars
-           (only print how many files and lines are in violation)
         """
         tabs = {}
         trailing_ws = {}
@@ -321,9 +321,9 @@
                 'Tab characters were found in the following source files.'
                 '\nThey should either be replaced by "\\t" or by spaces:'))
         if trailing_ws:
-            problems.append(self._format_message(trailing_ws,
-                'Trailing white space was found in the following source files:'
-                ))
+            print ("There are %i lines with trailing white space in %i files."
+                % (sum([len(lines) for f, lines in trailing_ws.items()]),
+                    len(trailing_ws)))
         if illegal_newlines:
             problems.append(self._format_message(illegal_newlines,
                 'Non-unix newlines were found in the following source files:'))
@@ -338,7 +338,6 @@
                '\n\n    %s'
                % ('\n    '.join(no_newline_at_eof)))
         if problems:
-            raise KnownFailure("test_coding_style has failed")
             self.fail('\n\n'.join(problems))
 
     def test_no_asserts(self):

=== modified file 'doc/developers/HACKING.txt'
--- a/doc/developers/HACKING.txt	2009-03-19 03:24:00 +0000
+++ b/doc/developers/HACKING.txt	2009-03-28 10:10:14 +0000
@@ -385,7 +385,8 @@
 We use 4 space indents for blocks, and never use tab characters.  (In vim,
 ``set expandtab``.)
 
-No trailing white space is allowed.
+Trailing white space should be avoided, but is allowed.
+You should however not make lots of unrelated white space changes.
 
 Unix style newlines (LF) are used.
 




More information about the bazaar-commits mailing list