1 # Copyright 2013 The Chromium 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.
6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
7 for more details on the presubmit API built into gcl.
12 def CheckChange(input_api
, output_api
):
15 for f
in input_api
.AffectedFiles():
16 if not f
.LocalPath().endswith('suppressions.txt'):
18 for line_num
, line
in enumerate(f
.NewContents()):
20 if line
.startswith('#') or not line
:
22 if not line
.startswith('leak:'):
23 errors
.append('"%s" should be "leak:..." in %s line %d' %
24 (line
, f
.LocalPath(), line_num
))
26 return [output_api
.PresubmitError('\n'.join(errors
))]
29 def CheckChangeOnUpload(input_api
, output_api
):
30 return CheckChange(input_api
, output_api
)
32 def CheckChangeOnCommit(input_api
, output_api
):
33 return CheckChange(input_api
, output_api
)