| Index: tools/presubmit.py
|
| ===================================================================
|
| --- tools/presubmit.py (revision 2110)
|
| +++ tools/presubmit.py (working copy)
|
| @@ -137,7 +137,7 @@
|
| or (name == 'third_party'))
|
|
|
| IGNORE_LINT = ['flag-definitions.h']
|
| -
|
| +
|
| def IgnoreFile(self, name):
|
| return (super(CppLintProcessor, self).IgnoreFile(name)
|
| or (name in CppLintProcessor.IGNORE_LINT))
|
| @@ -180,10 +180,12 @@
|
| 'libraries.cc', 'libraries-empty.cc', 'jsmin.py', 'regexp-pcre.js']
|
| IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js',
|
| 'html-comments.js']
|
| + NO_TRAILING_WHITESPACE_EXTENSIONS = ['py', 'SConscript', 'SConstruct']
|
|
|
| def ProcessContents(self, name, contents):
|
| result = True
|
| base = basename(name)
|
| + extension = base.split('.').pop()
|
| if not base in SourceProcessor.IGNORE_TABS:
|
| if '\t' in contents:
|
| print "%s contains tabs" % name
|
| @@ -192,6 +194,10 @@
|
| if not COPYRIGHT_HEADER_PATTERN.search(contents):
|
| print "%s is missing a correct copyright header." % name
|
| result = False
|
| + if extension in SourceProcessor.NO_TRAILING_WHITESPACE_EXTENSIONS:
|
| + if ' \n' in contents or contents.endswith(' '):
|
| + print "%s has trailing whitespace." % name
|
| + result = False
|
| return result
|
|
|
| def ProcessFiles(self, files):
|
|
|