| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 the V8 project authors. All rights reserved. |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 if name.endswith(ext): | 241 if name.endswith(ext): |
| 242 return True | 242 return True |
| 243 return False | 243 return False |
| 244 | 244 |
| 245 def GetPathsToSearch(self): | 245 def GetPathsToSearch(self): |
| 246 return ['.'] | 246 return ['.'] |
| 247 | 247 |
| 248 def IgnoreDir(self, name): | 248 def IgnoreDir(self, name): |
| 249 return (super(SourceProcessor, self).IgnoreDir(name) | 249 return (super(SourceProcessor, self).IgnoreDir(name) |
| 250 or (name == 'third_party') | 250 or (name == 'third_party') |
| 251 or (name == 'gyp') |
| 252 or (name == 'out') |
| 251 or (name == 'obj')) | 253 or (name == 'obj')) |
| 252 | 254 |
| 253 IGNORE_COPYRIGHTS = ['earley-boyer.js', 'raytrace.js', 'crypto.js', | 255 IGNORE_COPYRIGHTS = ['cpplint.py', |
| 254 'libraries.cc', 'libraries-empty.cc', 'jsmin.py', 'regexp-pcre.js'] | 256 'earley-boyer.js', |
| 255 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', | 257 'raytrace.js', |
| 256 'html-comments.js'] | 258 'crypto.js', |
| 259 'libraries.cc', |
| 260 'libraries-empty.cc', |
| 261 'jsmin.py', |
| 262 'regexp-pcre.js'] |
| 263 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', 'html-comments.js'] |
| 257 | 264 |
| 258 def ProcessContents(self, name, contents): | 265 def ProcessContents(self, name, contents): |
| 259 result = True | 266 result = True |
| 260 base = basename(name) | 267 base = basename(name) |
| 261 if not base in SourceProcessor.IGNORE_TABS: | 268 if not base in SourceProcessor.IGNORE_TABS: |
| 262 if '\t' in contents: | 269 if '\t' in contents: |
| 263 print "%s contains tabs" % name | 270 print "%s contains tabs" % name |
| 264 result = False | 271 result = False |
| 265 if not base in SourceProcessor.IGNORE_COPYRIGHTS: | 272 if not base in SourceProcessor.IGNORE_COPYRIGHTS: |
| 266 if not COPYRIGHT_HEADER_PATTERN.search(contents): | 273 if not COPYRIGHT_HEADER_PATTERN.search(contents): |
| (...skipping 29 matching lines...) Expand all Loading... |
| 296 success = CppLintProcessor().Run(workspace) and success | 303 success = CppLintProcessor().Run(workspace) and success |
| 297 success = SourceProcessor().Run(workspace) and success | 304 success = SourceProcessor().Run(workspace) and success |
| 298 if success: | 305 if success: |
| 299 return 0 | 306 return 0 |
| 300 else: | 307 else: |
| 301 return 1 | 308 return 1 |
| 302 | 309 |
| 303 | 310 |
| 304 if __name__ == '__main__': | 311 if __name__ == '__main__': |
| 305 sys.exit(Main()) | 312 sys.exit(Main()) |
| OLD | NEW |