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

# This script is the entry point for the Travis tests platform.
# It allows Travis to checkout on OpenFisca-Core, OpenFisca-France and OpenFisca-Parsers
# the git branch with the same name than the tested branch,
# so that the pull-request merge status remains valid.


set -x


function checkout {
  name="$1"
  DIR=`python -c "import pkg_resources; print pkg_resources.get_distribution('$name').location"`
  pushd "$DIR"
  git checkout "$TRAVIS_BRANCH"
  popd
}


if [ "$TRAVIS_BRANCH" != "master" ]; then
  checkout "OpenFisca-Core"
  checkout "OpenFisca-France"
  checkout "OpenFisca-Parsers"
fi


make test<commit_msg>Enforce version and CHANGELOG updating<commit_after>#! /usr/bin/env bash

# This script is the entry point for the Travis tests platform.
# It allows Travis to checkout on OpenFisca-Core, OpenFisca-France and OpenFisca-Parsers
# the git branch with the same name than the tested branch,
# so that the pull-request merge status remains valid.


set -x

current_version=`python setup.py --version`
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" != false ]]
then
    if git rev-parse $current_version
    then
        set +x
        echo "Version $version already exists. Please update version number in setup.py before merging this branch into master."
        exit 1
    fi

    if git diff-index master --quiet CHANGELOG.md
    then
        set +x
        echo "CHANGELOG.md has not been modified. Please update it before merging this branch into master."
        exit 1
    fi
fi

function checkout {
  name="$1"
  DIR=`python -c "import pkg_resources; print pkg_resources.get_distribution('$name').location"`
  pushd "$DIR"
  git checkout "$TRAVIS_BRANCH"
  popd
}


if [ "$TRAVIS_BRANCH" != "master" ]; then
  checkout "OpenFisca-Core"
  checkout "OpenFisca-France"
  checkout "OpenFisca-Parsers"
fi


make test
{'fraction_non_alphanumeric': 0.0926906779661017, 'fraction_numerical': 0.00211864406779661, 'mean_word_length': 3.6641975308641976, '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': '2715068', 'n_tokens_mistral': 640, 'n_tokens_neox': 601, 'n_words': 213}