blob: d2903093e25033fb10db8f8c1aa348ce519d205a [file] [log] [blame]
andrew@webrtc.org2442de12012-01-23 17:45:41 +00001# 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.comda159d62011-05-30 11:51:34 +00008
9def CheckChangeOnUpload(input_api, output_api):
andrew@webrtc.org2442de12012-01-23 17:45:41 +000010 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.comda159d62011-05-30 11:51:34 +000024 results = []
andrew@webrtc.org2442de12012-01-23 17:45:41 +000025 # 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.comda159d62011-05-30 11:51:34 +000033 return results
34
andrew@webrtc.org2442de12012-01-23 17:45:41 +000035def CheckChangeOnCommit(input_api, output_api):
niklase@google.com1198db92011-06-09 07:07:24 +000036 results = []
37 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api))
38 return results