<commit_before>#!/usr/bin/env bash

PHP='/usr/bin/env php'
RETURN=0

# check PHP files
for FILE in `find attributemap bin config-templates lib metadata-templates modules templates www -name "*.php"`; do
    $PHP -l $FILE > /dev/null 2>&1
    if [ $? -ne 0 ]; then
        echo "Syntax check failed for ${FILE}"
        RETURN=`expr ${RETURN} + 1`
    fi
done

# check JSON files
for FILE in `find dictionaries modules -name "*.json"`; do
    $PHP -r "exit((json_decode(file_get_contents('$FILE')) === null) ? 1 : 0);"
    if [ $? -ne 0 ]; then
        echo "Syntax check failed for ${FILE}"
        RETURN=`expr ${RETURN} + 1`
    fi
done

exit $RETURN<commit_msg>Also syntax-check the tests<commit_after>#!/usr/bin/env bash

PHP='/usr/bin/env php'
RETURN=0

# check PHP files
for FILE in `find attributemap bin config-templates lib metadata-templates modules templates tests www -name "*.php"`; do
    $PHP -l $FILE > /dev/null 2>&1
    if [ $? -ne 0 ]; then
        echo "Syntax check failed for ${FILE}"
        RETURN=`expr ${RETURN} + 1`
    fi
done

# check JSON files
for FILE in `find dictionaries modules -name "*.json"`; do
    $PHP -r "exit((json_decode(file_get_contents('$FILE')) === null) ? 1 : 0);"
    if [ $? -ne 0 ]; then
        echo "Syntax check failed for ${FILE}"
        RETURN=`expr ${RETURN} + 1`
    fi
done

exit $RETURN
{'fraction_non_alphanumeric': 0.15059347181008903, 'fraction_numerical': 0.013353115727002967, 'mean_word_length': 2.921511627906977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '723894', 'n_tokens_mistral': 472, 'n_tokens_neox': 440, 'n_words': 159}