<commit_before>#!/bin/bash
set -e
thisdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

compiler=g++
if [ "x$1" != "x" ];then
    compiler=$1
fi
export CXX=$compiler

modes='debug release'

for mode in $modes;do
    echo "+++ Checking $mode with $compiler ..."
    $compiler --version

    # Checking tests
    $thisdir/src/compile_test.sh $mode
    app=$thisdir/src/test.$mode
    echo "+++ Running $app ..."
    count=0
    while [ $count -lt 100 ]; do
        $app -z 0 > /dev/null
        let count+=1
    done
    echo "+++ Valgrinding $app ..."
    $thisdir/valgrind.sh $app
    echo "Tests OK"

    # Checking examples
    examples=$(ls $thisdir/examples/*.cpp)
    for ex in $examples; do
        $thisdir/examples/compile_example.sh $ex $mode
        app=${ex%.cpp}.$mode
        echo "+++ Running $app ..."
        $app
        if [[ $app != *"benchmark_"* ]]; then
            echo "+++ Valgrinding $app ..."
            $thisdir/valgrind.sh $app
        fi
        mv $(basename ${ex%.cpp}.dot) $thisdir/examples/
    done
    echo "Examples OK"
       
done

echo "+++ Done!"
<commit_msg>add cppcheck back in<commit_after>#!/bin/bash
set -e
thisdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

compiler=g++
if [ "x$1" != "x" ];then
    compiler=$1
fi
export CXX=$compiler

modes='debug release'

echo "+++ Running CppCheck ..."
$thisdir/cppcheck.sh

for mode in $modes;do
    echo "+++ Checking $mode with $compiler ..."
    $compiler --version

    # Checking tests
    $thisdir/src/compile_test.sh $mode
    app=$thisdir/src/test.$mode
    echo "+++ Running $app ..."
    count=0
    while [ $count -lt 100 ]; do
        $app -z 0 > /dev/null
        let count+=1
    done
    echo "+++ Valgrinding $app ..."
    $thisdir/valgrind.sh $app
    echo "Tests OK"

    # Checking examples
    examples=$(ls $thisdir/examples/*.cpp)
    for ex in $examples; do
        $thisdir/examples/compile_example.sh $ex $mode
        app=${ex%.cpp}.$mode
        echo "+++ Running $app ..."
        $app
        if [[ $app != *"benchmark_"* ]]; then
            echo "+++ Valgrinding $app ..."
            $thisdir/valgrind.sh $app
        fi
        mv $(basename ${ex%.cpp}.dot) $thisdir/examples/
    done
    echo "Examples OK"
       
done

echo "+++ Done!"

{'fraction_non_alphanumeric': 0.1743522178304787, 'fraction_numerical': 0.007905138339920948, 'mean_word_length': 2.1815642458100557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3251394', 'n_tokens_mistral': 831, 'n_tokens_neox': 773, 'n_words': 201}