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

# Copyright 2015 <NAME>
# Licensed under the AGPLv3
#
# Wrapper script around clang-format
#
# Usage:
# ./clang_format.sh (style) (lines) (file)
#
# Example:
# ./clang_format.sh Google 1:9999999 test.cpp
# ./clang_format.sh "{key: value, ...}" 1:9999999 test.cpp

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
LINK="$DIR/clang_format"

# Try to link clang-format to ./
# We don't want to run the find step every time the script runs
if [ ! -e ${LINK} ]; then
    # Possible locations of clang-format
    cfpath=(
        "/usr/bin/clang-format"
        "/usr/local/bin/clang-format"
        "/usr/local/llvm34/bin/clang-format"
        "/usr/local/llvm35/bin/clang-format"
        "/usr/bin/clang-format-3.5"
    )

    # Try to find binary
    binary=""

    for path in "${cfpath[@]}"
    do
        if [ -e ${path} ]; then
            binary=${path}
        fi
    done

    if [ binary == "" ]; then
        exit 0
    else
        ln -s ${binary} ${LINK}
    fi
fi

# If we have clang-format, execute it
if [ -e ${LINK} ]; then
    ${LINK} -style="$1" $3
fi<commit_msg>Updated script to be invokable with -c<commit_after>#!/usr/bin/env bash

# Copyright 2015 <NAME>
# Licensed under the AGPLv3
#
# Wrapper script around clang-format
#
# Usage:
# ./clang_format.sh (style) (file)
#
# Example:
# ./clang_format.sh Google test.cpp
# ./clang_format.sh "{key: value, ...}" test.cpp

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
LINK="$DIR/clang_format"

# Try to link clang-format to ./
# We don't want to run the find step every time the script runs
if [ ! -e ${LINK} ]; then
    # Possible locations of clang-format
    cfpath=(
        "/usr/bin/clang-format"
        "/usr/local/bin/clang-format"
        "/usr/local/llvm34/bin/clang-format"
        "/usr/local/llvm35/bin/clang-format"
        "/usr/bin/clang-format-3.5"
    )

    # Try to find binary
    binary=""

    for path in "${cfpath[@]}"
    do
        if [ -e ${path} ]; then
            binary=${path}
        fi
    done

    if [ binary == "" ]; then
        exit 0
    else
        ln -s ${binary} ${LINK}
    fi
fi

# If we have clang-format, execute it
# $0 / $1 due to bash behavior when running the script with -c
if [ -e ${LINK} ]; then
    if [ "$#" -ne 3 ]; then
        ${LINK} -style="$0" $1
    else
        ${LINK} -style="$1" $2
    fi
    exit 0
fi
{'fraction_non_alphanumeric': 0.1647108130762783, 'fraction_numerical': 0.02179379715004191, 'mean_word_length': 2.230040595399188, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4068769', 'n_tokens_mistral': 896, 'n_tokens_neox': 844, 'n_words': 243}