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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 whitespace/indent | 93 whitespace/indent |
94 whitespace/labels | 94 whitespace/labels |
95 whitespace/line_length | 95 whitespace/line_length |
96 whitespace/newline | 96 whitespace/newline |
97 whitespace/operators | 97 whitespace/operators |
98 whitespace/parens | 98 whitespace/parens |
99 whitespace/tab | 99 whitespace/tab |
100 whitespace/todo | 100 whitespace/todo |
101 """.split() | 101 """.split() |
102 | 102 |
103 #TODO(bmeurer) : Fix and re - enable readability / check | 103 # TODO(bmeurer): Fix and re-enable readability/check |
104 | 104 |
105 LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') | 105 LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') |
106 | 106 |
107 | 107 |
108 def CppLintWorker(command): | 108 def CppLintWorker(command): |
109 try: | 109 try: |
110 process = subprocess.Popen(command, stderr=subprocess.PIPE) | 110 process = subprocess.Popen(command, stderr=subprocess.PIPE) |
111 process.wait() | 111 process.wait() |
112 out_lines = "" | 112 out_lines = "" |
113 error_count = -1 | 113 error_count = -1 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 return (super(CppLintProcessor, self).IgnoreDir(name) | 228 return (super(CppLintProcessor, self).IgnoreDir(name) |
229 or (name == 'third_party')) | 229 or (name == 'third_party')) |
230 | 230 |
231 IGNORE_LINT = ['flag-definitions.h'] | 231 IGNORE_LINT = ['flag-definitions.h'] |
232 | 232 |
233 def IgnoreFile(self, name): | 233 def IgnoreFile(self, name): |
234 return (super(CppLintProcessor, self).IgnoreFile(name) | 234 return (super(CppLintProcessor, self).IgnoreFile(name) |
235 or (name in CppLintProcessor.IGNORE_LINT)) | 235 or (name in CppLintProcessor.IGNORE_LINT)) |
236 | 236 |
237 def GetPathsToSearch(self): | 237 def GetPathsToSearch(self): |
238 return ['src', 'include', 'samples', join('test', 'cctest'), | 238 return ['src', 'include', 'samples', join('test', 'cctest')] |
239 join('test', 'unittests')] | |
240 | 239 |
241 def GetCpplintScript(self, prio_path): | 240 def GetCpplintScript(self, prio_path): |
242 for path in [prio_path] + os.environ["PATH"].split(os.pathsep): | 241 for path in [prio_path] + os.environ["PATH"].split(os.pathsep): |
243 path = path.strip('"') | 242 path = path.strip('"') |
244 cpplint = os.path.join(path, "cpplint.py") | 243 cpplint = os.path.join(path, "cpplint.py") |
245 if os.path.isfile(cpplint): | 244 if os.path.isfile(cpplint): |
246 return cpplint | 245 return cpplint |
247 | 246 |
248 return None | 247 return None |
249 | 248 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 success = SourceProcessor().Run(workspace) and success | 443 success = SourceProcessor().Run(workspace) and success |
445 success = CheckGeneratedRuntimeTests(workspace) and success | 444 success = CheckGeneratedRuntimeTests(workspace) and success |
446 if success: | 445 if success: |
447 return 0 | 446 return 0 |
448 else: | 447 else: |
449 return 1 | 448 return 1 |
450 | 449 |
451 | 450 |
452 if __name__ == '__main__': | 451 if __name__ == '__main__': |
453 sys.exit(Main()) | 452 sys.exit(Main()) |
OLD | NEW |