summaryrefslogtreecommitdiffstats
path: root/tools/valgrind/memcheck/PRESUBMIT.py
blob: dd9861c53a53f946656c797f564fdccb8dffab2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""

def CheckChange(input_api, output_api):
  """Checks that the user didn't paste 'Suppression:' into the file"""
  keyword = 'Suppression:'
  for f, line_num, line in input_api.RightHandSideLines(lambda x:
      x.LocalPath().endswith('.txt')):
    if keyword in line:
      text = '"%s" must not be included; %s line %s' % (
          keyword, f.LocalPath(), line_num)
      return [output_api.PresubmitError(text)]
  return []

def CheckChangeOnUpload(input_api, output_api):
  return CheckChange(input_api, output_api)

def CheckChangeOnCommit(input_api, output_api):
  return CheckChange(input_api, output_api)

def GetPreferredTrySlaves():
  return ['linux_valgrind', 'mac_valgrind']