| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 'v8-function-call.cc', | 352 'v8-function-call.cc', |
| 353 'v8-function-call.h', | 353 'v8-function-call.h', |
| 354 'v8-inspector-impl.cc', | 354 'v8-inspector-impl.cc', |
| 355 'v8-inspector-impl.h', | 355 'v8-inspector-impl.h', |
| 356 'v8-runtime-agent-impl.cc', | 356 'v8-runtime-agent-impl.cc', |
| 357 'v8-runtime-agent-impl.h', | 357 'v8-runtime-agent-impl.h', |
| 358 'gnuplot-4.6.3-emscripten.js', | 358 'gnuplot-4.6.3-emscripten.js', |
| 359 'zlib.js'] | 359 'zlib.js'] |
| 360 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', 'html-comments.js'] | 360 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', 'html-comments.js'] |
| 361 | 361 |
| 362 IGNORE_COPYRIGHTS_DIRECTORY = "test/test262/local-tests" |
| 363 |
| 362 def EndOfDeclaration(self, line): | 364 def EndOfDeclaration(self, line): |
| 363 return line == "}" or line == "};" | 365 return line == "}" or line == "};" |
| 364 | 366 |
| 365 def StartOfDeclaration(self, line): | 367 def StartOfDeclaration(self, line): |
| 366 return line.find("//") == 0 or \ | 368 return line.find("//") == 0 or \ |
| 367 line.find("/*") == 0 or \ | 369 line.find("/*") == 0 or \ |
| 368 line.find(") {") != -1 | 370 line.find(") {") != -1 |
| 369 | 371 |
| 370 def ProcessContents(self, name, contents): | 372 def ProcessContents(self, name, contents): |
| 371 result = True | 373 result = True |
| 372 base = basename(name) | 374 base = basename(name) |
| 373 if not base in SourceProcessor.IGNORE_TABS: | 375 if not base in SourceProcessor.IGNORE_TABS: |
| 374 if '\t' in contents: | 376 if '\t' in contents: |
| 375 print "%s contains tabs" % name | 377 print "%s contains tabs" % name |
| 376 result = False | 378 result = False |
| 377 if not base in SourceProcessor.IGNORE_COPYRIGHTS: | 379 if not base in SourceProcessor.IGNORE_COPYRIGHTS and \ |
| 380 not SourceProcessor.IGNORE_COPYRIGHTS_DIRECTORY in name: |
| 378 if not COPYRIGHT_HEADER_PATTERN.search(contents): | 381 if not COPYRIGHT_HEADER_PATTERN.search(contents): |
| 379 print "%s is missing a correct copyright header." % name | 382 print "%s is missing a correct copyright header." % name |
| 380 result = False | 383 result = False |
| 381 if ' \n' in contents or contents.endswith(' '): | 384 if ' \n' in contents or contents.endswith(' '): |
| 382 line = 0 | 385 line = 0 |
| 383 lines = [] | 386 lines = [] |
| 384 parts = contents.split(' \n') | 387 parts = contents.split(' \n') |
| 385 if not contents.endswith(' '): | 388 if not contents.endswith(' '): |
| 386 parts.pop() | 389 parts.pop() |
| 387 for part in parts: | 390 for part in parts: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 print "Running status-files check..." | 503 print "Running status-files check..." |
| 501 success &= StatusFilesProcessor().RunOnPath(workspace) | 504 success &= StatusFilesProcessor().RunOnPath(workspace) |
| 502 if success: | 505 if success: |
| 503 return 0 | 506 return 0 |
| 504 else: | 507 else: |
| 505 return 1 | 508 return 1 |
| 506 | 509 |
| 507 | 510 |
| 508 if __name__ == '__main__': | 511 if __name__ == '__main__': |
| 509 sys.exit(Main()) | 512 sys.exit(Main()) |
| OLD | NEW |