OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 26 matching lines...) Expand all Loading... |
37 sys.path.append(input_api.os_path.join( | 37 sys.path.append(input_api.os_path.join( |
38 input_api.PresubmitLocalPath(), 'tools')) | 38 input_api.PresubmitLocalPath(), 'tools')) |
39 from presubmit import CppLintProcessor | 39 from presubmit import CppLintProcessor |
40 from presubmit import SourceProcessor | 40 from presubmit import SourceProcessor |
41 | 41 |
42 results = [] | 42 results = [] |
43 if not CppLintProcessor().Run(input_api.PresubmitLocalPath()): | 43 if not CppLintProcessor().Run(input_api.PresubmitLocalPath()): |
44 results.append(output_api.PresubmitError("C++ lint check failed")) | 44 results.append(output_api.PresubmitError("C++ lint check failed")) |
45 if not SourceProcessor().Run(input_api.PresubmitLocalPath()): | 45 if not SourceProcessor().Run(input_api.PresubmitLocalPath()): |
46 results.append(output_api.PresubmitError( | 46 results.append(output_api.PresubmitError( |
47 "Copyright header and trailing whitespaces check failed")) | 47 "Copyright header, trailing whitespaces and two empty lines " \ |
| 48 "between declarations check failed")) |
48 return results | 49 return results |
49 | 50 |
50 | 51 |
51 def _CommonChecks(input_api, output_api): | 52 def _CommonChecks(input_api, output_api): |
52 """Checks common to both upload and commit.""" | 53 """Checks common to both upload and commit.""" |
53 results = [] | 54 results = [] |
54 results.extend(input_api.canned_checks.CheckOwners( | 55 results.extend(input_api.canned_checks.CheckOwners( |
55 input_api, output_api, source_file_filter=None)) | 56 input_api, output_api, source_file_filter=None)) |
56 results.extend(_V8PresubmitChecks(input_api, output_api)) | 57 results.extend(_V8PresubmitChecks(input_api, output_api)) |
57 return results | 58 return results |
58 | 59 |
59 | 60 |
60 def CheckChangeOnUpload(input_api, output_api): | 61 def CheckChangeOnUpload(input_api, output_api): |
61 results = [] | 62 results = [] |
62 results.extend(_CommonChecks(input_api, output_api)) | 63 results.extend(_CommonChecks(input_api, output_api)) |
63 return results | 64 return results |
64 | 65 |
65 | 66 |
66 def CheckChangeOnCommit(input_api, output_api): | 67 def CheckChangeOnCommit(input_api, output_api): |
67 results = [] | 68 results = [] |
68 results.extend(_CommonChecks(input_api, output_api)) | 69 results.extend(_CommonChecks(input_api, output_api)) |
69 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 70 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
70 input_api, output_api)) | 71 input_api, output_api)) |
71 return results | 72 return results |
OLD | NEW |