~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_source.py

  • Committer: John Arbash Meinel
  • Date: 2006-11-06 21:00:45 UTC
  • mto: This revision was merged to the branch mainline in revision 2122.
  • Revision ID: john@arbash-meinel.com-20061106210045-b88ae833b5443145
Remove tabs from source files, and add a test to keep it that way.

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
                help_text.append((' '*4) + fname)
253
253
 
254
254
            self.fail('\n'.join(help_text))
 
255
 
 
256
    def test_no_tabs(self):
 
257
        """bzrlib source files should not contain any tab characters."""
 
258
        incorrect = []
 
259
 
 
260
        for fname, text in self.get_source_file_contents():
 
261
            if '\t' in text:
 
262
                incorrect.append(fname)
 
263
 
 
264
        if incorrect:
 
265
            self.fail('Tab characters were found in the following source files.'
 
266
              '\nThey should either be replaced by "\\t" or by spaces:'
 
267
              '\n\n    %s'
 
268
              % ('\n    '.join(incorrect)))