<commit_before>#!/bin/bash


# See https://docs.travis-ci.com/user/environment-variables/#convenience-variables
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_COMMIT: ${TRAVIS_COMMIT}"

# If FILES_CHANGED is set to all, run codecheck tests on all files,
# otherwise only run on changed files listed in PY_FILES_CHANGED
FILES_CHANGED="all"
PY_FILES_CHANGED=""
RQ_FILES_CHANGED=""

if [ ! -z "${TRAVIS_COMMIT_RANGE}" ]; then
  # This isn't a new branch

  echo "TRAVIS_COMMIT_RANGE: ${TRAVIS_COMMIT_RANGE}"

  if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
    # This isn't a PR build

    # We need the individual commits to detect force pushes
    COMMIT1="$(echo "${TRAVIS_COMMIT_RANGE}" | cut -f 1 -d '.')"
    COMMIT2="$(echo "${TRAVIS_COMMIT_RANGE}" | cut -f 4 -d '.')"

    if [ "$(git cat-file -t "${COMMIT1}" 2>/dev/null)" != "commit" ] || [ "$(git cat-file -t "${COMMIT2}" 2>/dev/null)" != "commit" ]; then
      # This is a normal build
      COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}"
    fi
  else
    # This is a PR build<commit_msg>Fix logic for detecting history rewrites.<commit_after>#!/bin/bash

# See https://docs.travis-ci.com/user/environment-variables/#convenience-variables
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_COMMIT: ${TRAVIS_COMMIT}"
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"

# If FILES_CHANGED is set to all, run codecheck tests on all files,
# otherwise only run on changed files listed in PY_FILES_CHANGED
FILES_CHANGED="all"
PY_FILES_CHANGED=""
RQ_FILES_CHANGED=""

if [ ! -z "${TRAVIS_COMMIT_RANGE}" ]; then
  # This isn't a new branch

  echo "TRAVIS_COMMIT_RANGE: ${TRAVIS_COMMIT_RANGE}"

  if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
    # This isn't a PR build

    # We need the individual commits to detect force pushes
    COMMIT1="$(echo "${TRAVIS_COMMIT_RANGE}" | cut -f 1 -d '.')"
    COMMIT2="$(echo "${TRAVIS_COMMIT_RANGE}" | cut -f 4 -d '.')"

    if [ "$(git cat-file -t "${COMMIT1}" 2>/dev/null)" == "commit" ] && [ "$(git cat-file -t "${COMMIT2}" 2>/dev/null)" == "commit" ]; then
      # Both commits exist, this isn't a rewrite of history
      COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}"
    fi
  else
    # This is a PR build
{'fraction_non_alphanumeric': 0.15402089959109497, 'fraction_numerical': 0.007269422989550204, 'mean_word_length': 4.109048723897912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4780198', 'n_tokens_mistral': 851, 'n_tokens_neox': 815, 'n_words': 215}