<commit_before>set -e

source "$(git rev-parse --show-toplevel)/scripts/common.sh"

function main() {
  if [[ $TRAVIS_RUST_VERSION -eq "nightly" && -z $(which rustfmt) ]]; then
    echo "==> installing rustfmt-nightly"
    cargo install rustfmt-nightly
  fi

  echo "==> checking formatting"
  cargo fmt -- --write-mode=diff

  if [[ -z $(which cargo-clippy) ]]; then
    echo "==> installing cargo-clippy"
    cargo install clippy
  fi

  echo "==> checking clippy lints"
  cargo clippy
}

main "$@"
<commit_msg>Force install rustfmt on Travis<commit_after>set -e

source "$(git rev-parse --show-toplevel)/scripts/common.sh"

function main() {
  if [[ $TRAVIS_RUST_VERSION -eq "nightly" ]]; then
    echo "==> installing rustfmt-nightly"
    cargo install rustfmt-nightly --force
  fi

  echo "==> checking formatting"
  cargo fmt -- --write-mode=diff

  if [[ -z $(which cargo-clippy) ]]; then
    echo "==> installing cargo-clippy"
    cargo install clippy
  fi

  echo "==> checking clippy lints"
  cargo clippy
}

main "$@"

{'fraction_non_alphanumeric': 0.1477162293488824, 'fraction_numerical': 0.0, 'mean_word_length': 3.2738589211618256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2173157', 'n_tokens_mistral': 369, 'n_tokens_neox': 357, 'n_words': 98}