andrew@webrtc.org | 2442de1 | 2012-01-23 17:45:41 +0000 | [diff] [blame^] | 1 | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license |
| 4 | # that can be found in the LICENSE file in the root of the source |
| 5 | # tree. An additional intellectual property rights grant can be found |
| 6 | # in the file PATENTS. All contributing project authors may |
| 7 | # be found in the AUTHORS file in the root of the source tree. |
niklase@google.com | da159d6 | 2011-05-30 11:51:34 +0000 | [diff] [blame] | 8 | |
| 9 | def CheckChangeOnUpload(input_api, output_api): |
andrew@webrtc.org | 2442de1 | 2012-01-23 17:45:41 +0000 | [diff] [blame^] | 10 | webrtc_license_header = ( |
| 11 | r'.*? Copyright \(c\) %(year)s The WebRTC project authors\. ' |
| 12 | r'All Rights Reserved\.\n' |
| 13 | r'.*?\n' |
| 14 | r'.*? Use of this source code is governed by a BSD-style license\n' |
| 15 | r'.*? that can be found in the LICENSE file in the root of the source\n' |
| 16 | r'.*? tree\. An additional intellectual property rights grant can be ' |
| 17 | r'found\n' |
| 18 | r'.*? in the file PATENTS\. All contributing project authors may\n' |
| 19 | r'.*? be found in the AUTHORS file in the root of the source tree\.\n' |
| 20 | ) % { |
| 21 | 'year': input_api.time.strftime('%Y'), |
| 22 | } |
| 23 | |
niklase@google.com | da159d6 | 2011-05-30 11:51:34 +0000 | [diff] [blame] | 24 | results = [] |
andrew@webrtc.org | 2442de1 | 2012-01-23 17:45:41 +0000 | [diff] [blame^] | 25 | # Ideally, maxlen would be 80. |
| 26 | results.extend(input_api.canned_checks.CheckLongLines( |
| 27 | input_api, output_api, maxlen=95)) |
| 28 | results.extend(input_api.canned_checks.CheckChangeHasNoTabs( |
| 29 | input_api, output_api)) |
| 30 | results.extend(input_api.canned_checks.CheckLicense( |
| 31 | input_api, output_api, webrtc_license_header)) |
| 32 | |
niklase@google.com | da159d6 | 2011-05-30 11:51:34 +0000 | [diff] [blame] | 33 | return results |
| 34 | |
andrew@webrtc.org | 2442de1 | 2012-01-23 17:45:41 +0000 | [diff] [blame^] | 35 | def CheckChangeOnCommit(input_api, output_api): |
niklase@google.com | 1198db9 | 2011-06-09 07:07:24 +0000 | [diff] [blame] | 36 | results = [] |
| 37 | results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) |
| 38 | return results |