<commit_before><commit_msg>Before commiting some cpplint and cppchecks!<commit_after>#!/usr/bin/env python
# Copyright (c) 2015 The Subzone Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Performs some basic lint checks on the tree.
"""
import os
import sys
import re
import subprocess

def Main():
  """Search crypto and net directories for *.cc and *.h files"""
  matches = []
  directories = [ 'crypto', 'net' ]

  cc_re = re.compile(r'.+\.(cc|h)$', re.IGNORECASE)

  for dirs in directories:
    for root, dirnames, filenames in os.walk(dirs):
      for name in filenames:
        if cc_re.match(name):
          matches.append(os.path.join(root, name))

  """Run linters against these files"""
  subprocess.call(["/home/zeus/opt/depot_tools/cpplint.py"] + matches)
  subprocess.call(["/home/zeus/bin/cppcheck", "--enable=all"] + matches)

if __name__ == '__main__':
  sys.exit(Main())
{'fraction_non_alphanumeric': 0.1390593047034765, 'fraction_numerical': 0.00408997955010225, 'mean_word_length': 3.8226600985221677, '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': '464075', 'n_tokens_mistral': 335, 'n_tokens_neox': 318, 'n_words': 102}