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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 sys.stderr.write(out_line) | 214 sys.stderr.write(out_line) |
215 m = LINT_ERROR_PATTERN.match(out_line) | 215 m = LINT_ERROR_PATTERN.match(out_line) |
216 if m: | 216 if m: |
217 good_files_cache.RemoveFile(m.group(1)) | 217 good_files_cache.RemoveFile(m.group(1)) |
218 | 218 |
219 good_files_cache.Save() | 219 good_files_cache.Save() |
220 return process.returncode == 0 | 220 return process.returncode == 0 |
221 | 221 |
222 | 222 |
223 COPYRIGHT_HEADER_PATTERN = re.compile( | 223 COPYRIGHT_HEADER_PATTERN = re.compile( |
224 r'Copyright [\d-]*20[0-1][0-9] the V8 project authors. All rights reserved.'
) | 224 r'Copyright [\d-]*200[8-9] the V8 project authors. All rights reserved.') |
225 | 225 |
226 class SourceProcessor(SourceFileProcessor): | 226 class SourceProcessor(SourceFileProcessor): |
227 """ | 227 """ |
228 Check that all files include a copyright notice. | 228 Check that all files include a copyright notice. |
229 """ | 229 """ |
230 | 230 |
231 RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c', 'SConscript', | 231 RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c', 'SConscript', |
232 'SConstruct', '.status'] | 232 'SConstruct', '.status'] |
233 def IsRelevant(self, name): | 233 def IsRelevant(self, name): |
234 for ext in SourceProcessor.RELEVANT_EXTENSIONS: | 234 for ext in SourceProcessor.RELEVANT_EXTENSIONS: |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 success = CppLintProcessor().Run(workspace) and success | 290 success = CppLintProcessor().Run(workspace) and success |
291 success = SourceProcessor().Run(workspace) and success | 291 success = SourceProcessor().Run(workspace) and success |
292 if success: | 292 if success: |
293 return 0 | 293 return 0 |
294 else: | 294 else: |
295 return 1 | 295 return 1 |
296 | 296 |
297 | 297 |
298 if __name__ == '__main__': | 298 if __name__ == '__main__': |
299 sys.exit(Main()) | 299 sys.exit(Main()) |
OLD | NEW |