<commit_before>#!/bin/bash

DOCS_DIR="docs"

generate_docs() {
    echo -e "Generating docs \n"

    local MASTER_BRANCH="master"
    local BUILD_DIR BRANCH_NAME
    local IS_PR=false

    if [[ $CIRCLECI ]]; then
        BRANCH_NAME=$CIRCLE_BRANCH
        BUILD_DIR=$(pwd)
        IS_PR=$CI_PULL_REQUEST
    elif [[ $TRAVIS ]]; then
        BRANCH_NAME=$TRAVIS_BRANCH
        BUILD_DIR=$TRAVIS_BUILD_DIR
        IS_PR="$TRAVIS_PULL_REQUEST"
    else
        BUILD_DIR="$HOME/workspace/CoreDataStack"
        BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
        MASTER_BRANCH=$BRANCH_NAME
        echo "=================Not Running in CI================="
    fi

    if [ "$IS_PR" == "false" ]; then
        if [[ $BRANCH_NAME = "$MASTER_BRANCH" ]]; then
            echo -e "Generating Jazzy output \n"
            jazzy --output "$BUILD_DIR"/"$DOCS_DIR" --clean --config "$BUILD_DIR"/.jazzy.yml
        else
            echo "Aborting doc generation. Not on master branch." 1>&2
            exit 1
        fi
    else
        echo "Aborting doc generation. This is a pull request" 1>&2
        exit 1
    fi
}

commit_changes() {
    local build_num
    if [[ $CIRCLECI ]]; then
        build_num=$CIRCLE_BUILD_NUM     
    elif [[ $TRAVIS ]]; then
        build_num=$TRAVIS_BUILD_NUMBER
    else
        echo "=================Not Running in CI================="
        exit 1
    fi
<commit_msg>Only generate docs for non-pull request builds<commit_after>#!/bin/bash

DOCS_DIR="docs"

generate_docs() {
    echo -e "Generating docs \n"

    local MASTER_BRANCH="master"
    local BUILD_DIR BRANCH_NAME
    local IS_PR=false

    if [[ $CIRCLECI ]]; then
        BRANCH_NAME=$CIRCLE_BRANCH
        BUILD_DIR=$(pwd)
        IS_PR=$CI_PULL_REQUEST
    elif [[ $TRAVIS ]]; then
        BRANCH_NAME=$TRAVIS_BRANCH
        BUILD_DIR=$TRAVIS_BUILD_DIR
        IS_PR="$TRAVIS_PULL_REQUEST"
    else
        BUILD_DIR="$HOME/workspace/CoreDataStack"
        BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
        IS_PR=false
        echo "=================Not Running in CI================="
    fi

    if [ "$IS_PR" == "false" ]; then
        if [[ $BRANCH_NAME = "$MASTER_BRANCH" ]]; then
            echo -e "Generating Jazzy output \n"
            jazzy --output "$BUILD_DIR"/"$DOCS_DIR" --clean --podspec "$BUILD_DIR"/BNRCoreDataStack.podspec --module "CoreDataStack" --config "$BUILD_DIR"/.jazzy.yml
        else
            echo "Aborting doc generation. Not on master branch." 1>&2
            exit 1
        fi
    else
        echo "Aborting doc generation. This is a pull request" 1>&2
        exit 1
    fi
}

commit_changes() {
    local build_num
    if [[ $CIRCLECI ]]; then
        build_num=$CIRCLE_BUILD_NUM     
    elif [[ $TRAVIS ]]; then
        build_num=$TRAVIS_BUILD_NUMBER
    else
        echo "=================Not Running in CI================="
        exit 1
    fi

{'fraction_non_alphanumeric': 0.14946496375560925, 'fraction_numerical': 0.004832585433206766, 'mean_word_length': 2.346420323325635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1535523', 'n_tokens_mistral': 1009, 'n_tokens_neox': 960, 'n_words': 224}