Mandeep Singh Baines | 863b757 | 2010-10-13 13:48:04 -0700 | [diff] [blame^] | 1 | # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Top-level presubmit script for kernel. |
| 6 | |
| 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details about the presubmit API built into gcl and git cl. |
| 9 | """ |
| 10 | |
| 11 | def CheckSignOff(input_api, output_api, source_file_filter=None): |
| 12 | """Checks that there is a Signed-off-by in the description.""" |
| 13 | output = [] |
| 14 | if input_api.change.DescriptionText().count('Signed-off-by:') == 0: |
| 15 | output.append(output_api.PresubmitError( |
| 16 | 'This project requires all commits to contain a Signed-off-by:')) |
| 17 | return output |
| 18 | |
| 19 | def CheckChange(input_api, output_api, committing): |
| 20 | results = [] |
| 21 | results += CheckSignOff(input_api, output_api) |
| 22 | return results |
| 23 | |
| 24 | def CheckChangeOnUpload(input_api, output_api): |
| 25 | return CheckChange(input_api, output_api, False) |
| 26 | |
| 27 | def CheckChangeOnCommit(input_api, output_api): |
| 28 | return CheckChange(input_api, output_api, True) |