| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 import sys | 43 import sys |
| 44 import subprocess | 44 import subprocess |
| 45 import multiprocessing | 45 import multiprocessing |
| 46 from subprocess import PIPE | 46 from subprocess import PIPE |
| 47 | 47 |
| 48 # Special LINT rules diverging from default and reason. | 48 # Special LINT rules diverging from default and reason. |
| 49 # build/header_guard: Our guards have the form "V8_FOO_H_", not "SRC_FOO_H_". | 49 # build/header_guard: Our guards have the form "V8_FOO_H_", not "SRC_FOO_H_". |
| 50 # build/include_what_you_use: Started giving false positives for variables | 50 # build/include_what_you_use: Started giving false positives for variables |
| 51 # named "string" and "map" assuming that you needed to include STL headers. | 51 # named "string" and "map" assuming that you needed to include STL headers. |
| 52 # TODO(bmeurer): Fix and re-enable readability/check | 52 # TODO(bmeurer): Fix and re-enable readability/check |
| 53 # TODO(mstarzinger): Fix and re-enable readability/namespace | |
| 54 | 53 |
| 55 LINT_RULES = """ | 54 LINT_RULES = """ |
| 56 -build/header_guard | 55 -build/header_guard |
| 57 +build/include_alpha | 56 +build/include_alpha |
| 58 -build/include_what_you_use | 57 -build/include_what_you_use |
| 59 -build/namespaces | 58 -build/namespaces |
| 60 -readability/check | 59 -readability/check |
| 61 -readability/inheritance | 60 -readability/inheritance |
| 62 -readability/namespace | |
| 63 -readability/nolint | 61 -readability/nolint |
| 64 +readability/streams | 62 +readability/streams |
| 65 -runtime/references | 63 -runtime/references |
| 66 """.split() | 64 """.split() |
| 67 | 65 |
| 68 LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') | 66 LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') |
| 69 FLAGS_LINE = re.compile("//\s*Flags:.*--([A-z0-9-])+_[A-z0-9].*\n") | 67 FLAGS_LINE = re.compile("//\s*Flags:.*--([A-z0-9-])+_[A-z0-9].*\n") |
| 70 | 68 |
| 71 def CppLintWorker(command): | 69 def CppLintWorker(command): |
| 72 try: | 70 try: |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 success = SourceProcessor().Run(workspace) and success | 452 success = SourceProcessor().Run(workspace) and success |
| 455 success = CheckExternalReferenceRegistration(workspace) and success | 453 success = CheckExternalReferenceRegistration(workspace) and success |
| 456 if success: | 454 if success: |
| 457 return 0 | 455 return 0 |
| 458 else: | 456 else: |
| 459 return 1 | 457 return 1 |
| 460 | 458 |
| 461 | 459 |
| 462 if __name__ == '__main__': | 460 if __name__ == '__main__': |
| 463 sys.exit(Main()) | 461 sys.exit(Main()) |
| OLD | NEW |