<commit_before># 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 GetPreferredTrySlaves():
  return ['linux_valgrind', 'mac_valgrind']<commit_msg>Presumbit check for 'Suppression:' in valgrind suppressions<commit_after># 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']
{'fraction_non_alphanumeric': 0.10612244897959183, 'fraction_numerical': 0.005442176870748299, 'mean_word_length': 4.768627450980392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2475554', 'n_tokens_mistral': 472, 'n_tokens_neox': 460, 'n_words': 151}