blob: 785ec07d990fd6bbffebbe70eb6c5c9fb48d2d04 [file] [log] [blame]
Mandeep Singh Baines863b7572010-10-13 13:48:04 -07001# 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
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into gcl and git cl.
9"""
10
11def 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
19def CheckChange(input_api, output_api, committing):
20 results = []
21 results += CheckSignOff(input_api, output_api)
22 return results
23
24def CheckChangeOnUpload(input_api, output_api):
25 return CheckChange(input_api, output_api, False)
26
27def CheckChangeOnCommit(input_api, output_api):
28 return CheckChange(input_api, output_api, True)