<commit_before>#!/bin/bash
# set -ev
hyphenToTitleCase() { 
    tr '-' '\n' | awk '{printf "%s%s", toupper(substr($0,0,1)), substr($0,2)}';
}
files=$(git log -m -1 --name-only --pretty="format:" ${TRAVIS_COMMIT});

# split by space
post=$(echo $files | cut -f1 -d\ );
echo "- Post path: $post";
screenshot=$(echo $files | cut -f2 -d\ );
echo "- Screenshot path: $screenshot";

# test filename == xxxx-xx-xx-.*\.md
match=$(echo $post | grep -o "_posts/xxxx-xx-xx-.*\.md");
if [[ $match != $post ]]; then
  echo "$post does not match the pattern \"_posts/xxxx-xx-.*\.md\"";
  exit 1;
fi

# test _post file content

# layout == post
match=$(grep -o "layout:\ *post" $post);
if [[ $match == "" ]]; then
  echo "Incorrect layout. Should be \"post\".";
  exit 1;
fi

# slug == filename
match=$(grep "slug:.*" $post | sed "s/slug:\ *\(.*\)$/_posts\/xxxx-xx-xx-\1.md/");
if [[ $match != $post ]]; then<commit_msg>Don't worry about file name matching (#514)<commit_after>#!/bin/bash
# set -ev
hyphenToTitleCase() { 
    tr '-' '\n' | awk '{printf "%s%s", toupper(substr($0,0,1)), substr($0,2)}';
}
files=$(git log -m -1 --name-only --pretty="format:" ${TRAVIS_COMMIT});

# split by space
post=$(echo $files | cut -f1 -d\ );
echo "- Post path: $post";
screenshot=$(echo $files | cut -f2 -d\ );
echo "- Screenshot path: $screenshot";

# test filename == xxxx-xx-xx-.*\.md
# match=$(echo $post | grep -o "_posts/xxxx-xx-xx-.*\.md");
# if [[ $match != $post ]]; then
#   echo "$post does not match the pattern \"_posts/xxxx-xx-.*\.md\"";
#   exit 1;
# fi

# test _post file content

# layout == post
match=$(grep -o "layout:\ *post" $post);
if [[ $match == "" ]]; then
  echo "Incorrect layout. Should be \"post\".";
  exit 1;
fi

# slug == filename
match=$(grep "slug:.*" $post | sed "s/slug:\ *\(.*\)$/_posts\/xxxx-xx-xx-\1.md/");
if [[ $match != $post ]]; then
{'fraction_non_alphanumeric': 0.2524324324324324, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 3.324766355140187, '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': '4967012', 'n_tokens_mistral': 743, 'n_tokens_neox': 707, 'n_words': 199}