<commit_before>#!/usr/bin/env bash
set -ex

if [[ -z "$INTEGRATION" ]]; then
    exit 0
fi

CARGO_TARGET_DIR=$(pwd)/target/
export CARGO_TARGET_DIR

rm ~/.cargo/bin/cargo-clippy
cargo install --force --debug --path .

echo "Running integration test for crate ${INTEGRATION}"

git clone --depth=1 "https://github.com/${INTEGRATION}.git" checkout
cd checkout

# run clippy on a project, try to be verbose and trigger as many warnings
# as possible for greater coverage
RUST_BACKTRACE=full \
cargo clippy \
    --all-targets \
    --all-features \
    -- \
    --cap-lints warn \
    -W clippy::pedantic \
    -W clippy::nursery \
    > clippy_output 2>&1 || true

cargo uninstall clippy
cat clippy_output

if grep -q "internal compiler error\|query stack during panic\|E0463" clippy_output; then
    exit 1
fi<commit_msg>build: avoid timing out in Travis<commit_after>#!/usr/bin/env bash
set -ex

if [[ -z "$INTEGRATION" ]]; then
    exit 0
fi

CARGO_TARGET_DIR=$(pwd)/target/
export CARGO_TARGET_DIR

rm ~/.cargo/bin/cargo-clippy
cargo install --force --debug --path .

echo "Running integration test for crate ${INTEGRATION}"

git clone --depth=1 "https://github.com/${INTEGRATION}.git" checkout
cd checkout

# run clippy on a project, try to be verbose and trigger as many warnings
# as possible for greater coverage
# NOTE: we use `tee` to print any warnings and errors to stdout
#       to avoid build timeout in Travis
RUST_BACKTRACE=full \
cargo clippy \
    --all-targets \
    --all-features \
    -- \
    --cap-lints warn \
    -W clippy::pedantic \
    -W clippy::nursery \
    2>&1 | tee clippy_output

cargo uninstall clippy

if grep -q "internal compiler error\|query stack during panic\|E0463" clippy_output; then
    exit 1
fi
{'fraction_non_alphanumeric': 0.11487650775416428, 'fraction_numerical': 0.010338885697874785, 'mean_word_length': 3.137767220902613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '735119', 'n_tokens_mistral': 607, 'n_tokens_neox': 582, 'n_words': 194}