<commit_before>#!/usr/bin/env bash
# Grant that custom checks are working.
set -eo pipefail
# shellcheck disable=SC1091
source ./build.sh
check ./build.sh
<commit_msg>Add rudimentary test that we find expected files<commit_after>#!/usr/bin/env bash
# Grant that custom checks are working.
set -eo pipefail

# shellcheck disable=SC1091
source ./build.sh

# Lint the build script
echo "Linting the build.sh script..."
check ./build.sh

# Test that we find the correct amount of files.
echo -e "\nValidating the result of find_cmd()..."
files=$(eval "$(find_cmd)")
files_count=$(echo "$files" | wc -l)

expected_files_count=8
if (( files_count == expected_files_count )); then
  printf "\r\033[2K  [ \033[00;32mOK\033[0m ] Found the expected number of files (%s)\n" $expected_files_count
else
  printf "\r\033[2K  [\033[0;31mFAIL\033[0m] Build scripts’s find_cmd didn’t find the expected number of files (%s)\n" $expected_files_count
  printf "\r\033[2K         Files found:\n"
  for file in $files; do
    printf "\r\033[2K         - %s\n" "$file"
  done
  exit 1
fi

exit 0

{'fraction_non_alphanumeric': 0.12861136999068035, 'fraction_numerical': 0.04473438956197577, 'mean_word_length': 3.752212389380531, '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': '5256550', 'n_tokens_mistral': 403, 'n_tokens_neox': 371, 'n_words': 123}