<commit_before>#!/bin/sh

ERRORFILE="errors.txt"
coverage run --source=$1 setup.py test --test-suite=tests.unit -q 1>/dev/null 2>$ERRORFILE;
haserr=`grep FAILED $ERRORFILE`;
err=`cat $ERRORFILE`
rm $ERRORFILE;
coverage=`coverage report -m | grep TOTAL | sed 's/TOTAL\s*\w*\s*\w*\s*//g' | cut -d'%' -f1`

echo 'coverage was:' $coverage'%'

if [ "$haserr" != "" ]
then
    if [ $coverage -eq $2 ]
    then
	echo "But something went wrong";
	echo "$err";
	exit 1
    fi
fi

if [ $coverage -eq $2 ]
then
    if [ "$haserr" != "" ]
    then
	echo "And something went wrong";
	echo "$err";
	exit 1;
    else
	echo "Yay! Everything ok!";
	exit 0;
    fi

else
    coverage report -m
    exit 1
fi<commit_msg>check_coverage.sh<commit_after>#!/bin/sh

ERRORFILE="errors.txt"
coverage run --source=$1 setup.py test --test-suite=tests.unit -q 1>/dev/null 2>$ERRORFILE;
haserr=`grep FAILED $ERRORFILE`;
err=`cat $ERRORFILE`
rm $ERRORFILE;
coverage=`coverage report -m | grep TOTAL | sed 's/TOTAL\s*\w*\s*\w*\s*//g' | cut -d'%' -f1`

echo 'coverage was:' $coverage'%'

if [ "$haserr" != "" ]
then
    if [ $coverage -eq $2 ]
    then
	echo "But something went wrong";
	echo "$err";
	exit 1
    else
	echo "And something went wrong"
	echo "$err";
	exit 1
    fi
fi

if [ $coverage -eq $2 ]
then
    echo "Yay! Everything ok!";
    exit 0;
else
    coverage report -m
    exit 1
fi
{'fraction_non_alphanumeric': 0.17276720351390923, 'fraction_numerical': 0.014641288433382138, 'mean_word_length': 3.105105105105105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1532105', 'n_tokens_mistral': 569, 'n_tokens_neox': 542, 'n_words': 161}