<commit_before>#!/bin/bash

# TODO: until 3.6 safe, force 3.5
PYV="3.5"
FAUCETHOME=`dirname $0`"/../.."
PYTHONPATH=$FAUCETHOME:$FAUCETHOME/faucet:$FAUCETHOME/clib
SRCFILES="$FAUCETHOME/tests/codecheck/src_files.sh"

TMPD=`mktemp -d`
test -d $TMPD || exit
function cleanup {
  rm -r "$TMPD"
}
trap cleanup EXIT

PYTYPEARGS="pytype -V$PYV -o $TMPD --pythonpath $PYTHONPATH -d pyi-error,import-error -v2"

declare -A SRCDIRS
for f in `$SRCFILES` ; do
   d=`dirname $f`
   SRCDIRS[$d]="$f ${SRCDIRS[$d]}"
done

for d in "${!SRCDIRS[@]}" ; do
   srcfiles=${SRCDIRS[$d]}
   $PYTYPEARGS $srcfiles || exit 1
done<commit_msg>Revert "Run pytype by top level directory to limit memory usage."<commit_after>#!/bin/bash

# TODO: until 3.6 safe, force 3.5
PYV="3.5"
FAUCETHOME=`dirname $0`"/../.."
PYTHONPATH=$FAUCETHOME:$FAUCETHOME/faucet:$FAUCETHOME/clib
PARARGS="parallel --delay 1 --bar"
SRCFILES="$FAUCETHOME/tests/codecheck/src_files.sh"

TMPD=`mktemp -d`
test -d $TMPD || exit
function cleanup {
  rm -r "$TMPD"
}
trap cleanup EXIT

PYTYPEARGS="pytype -V$PYV -o $TMPD --pythonpath $PYTHONPATH -d pyi-error,import-error"
$PYTYPEARGS `$SRCFILES` || exit 1
{'fraction_non_alphanumeric': 0.17801047120418848, 'fraction_numerical': 0.015706806282722512, 'mean_word_length': 4.541062801932367, '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': '6242876', 'n_tokens_mistral': 509, 'n_tokens_neox': 491, 'n_words': 110}