<commit_before>#!/usr/bin/env bash
#
# TITLE       : Template title.
# DESCRIPTION : Template description.
# AUTHOR      : <NAME> <<EMAIL>>
# DATE        : 20170825
# VERSION     : 0.1.0-1
# USAGE       : bash template.sh or ./template.sh or ..
# REPOSITORY  : https://github.com/YOUR_USER/your_project
# -------------------------------------------------------------------

# General/global application variables
APP=${0/[\$\.\/]*\//}
APP_PATH=$(pwd)
APP_TITLE="${Cb}λ${Cn} Template"
APP_RECIPES=YES

# Semantic versioning
APP_VERSION_MAJOR=0
APP_VERSION_MINOR=1
APP_VERSION_BUILD=0
APP_VERSION_REVISION=1
APP_VERSION_CODENAME=silly
APP_VERSION_NICKNAME=package

function example {
    # Explains how documentation works

    $_e "I don't know what to do"
}

function colors {
    # Show color/style variable table

    $_e "Color/style variables:

    ${Cb}Cn${Cn}     ${Cn}Normal/reset${Cn}
    ${Cb}Cb${Cn}     ${Cb}Bold${Cn}
    ${Cb}Ci${Cn}     ${Ci}Italic${Cn}
    ${Cb}Cd${Cn}     ${Cd}Dark/gray${Cn}
    ${Cb}Cr${Cn}     ${Cr}Red${Cn}
    ${Cb}Cg${Cn}     ${Cg}Green${Cn}
    ${Cb}Cc${Cn}     ${Cc}Cian/Blue${Cn}
    ${Cb}Cy${Cn}     ${Cy}Yellow${Cn}"
}

function multi {
    # Try multi options (with helper)

    function one {
        #multi: Function one must return success
        success message "This returns success"

        [[ "$FAILURE" != "" ]] && fail "Fail message"
        success
    }

    function two {
        #multi: Function two must return success
        success message "This must return fail"

        fail "That will fail"

        success
    }

    # Ensure multilevel
    checkOptions "$@"
}



#
#       AVOID change above the safety line.
#
# -------------------------------------------------- SAFETY LINE ----

function show_header {
    title="${Cb}${APP_TITLE}${Cn} v$(version print)"
    printable=$($_e -E "${title}" | sed 's/\\[\e0-9]*\[[0-9;]*\m//g')

    $_e "\n\n$title\n$(printf "%${#printable}s" | tr ' ' '-')\n"
}

function version {
    # Semantic versioning tool.

    function print {
        #version: Prints semantic version.
        TEXT="${APP_VERSION_MAJOR}"
        NICK="${APP_VERSION_CODENAME}"

        for O in \
        $APP_VERSION_MINOR \
        $APP_VERSION_BUILD
        do  [ ! -z "${O}" ] && \
            TEXT+=".${O}"
        done

        [ ! -z "${APP_VERSION_REVISION}" ] && TEXT+="-${APP_VERSION_REVISION}"
        [ ! -z "${APP_VERSION_NICKNAME}" ] && NICK+=" ${APP_VERSION_NICKNAME}"

        [ ! -z "${NICK}" ] && TEXT+=" '${NICK}'"

        $_e "${TEXT}"
    }

    function check {
        #version: Check if current version matches last (actual) GIT tag.
        require git
        exit 0
    }

    checkOptions "$@"
}

function require {
    for required in $*
    do [ -z $(which "${required}") ] && fail "${Cb}${required}${Cn} required."
    done
}

SHORT=

declare -a commands
commands=()
<commit_msg>adicionada função para verificação semântica de agulhas em palheiros adicionada opção de não inclusão do nick na versão adicionada verificação de existência de tag na versão atual<commit_after>#!/usr/bin/env bash
#
# TITLE       : Template title.
# DESCRIPTION : Template description.
# AUTHOR      : <NAME> <<EMAIL>>
# DATE        : 20170825
# VERSION     : 0.1.0-1
# USAGE       : bash template.sh or ./template.sh or ..
# REPOSITORY  : https://github.com/YOUR_USER/your_project
# -------------------------------------------------------------------

# General/global application variables
APP=${0/[\$\.\/]*\//}
APP_PATH=$(pwd)
APP_TITLE="${Cb}λ${Cn} Template"
APP_RECIPES=YES

# Semantic versioning
APP_VERSION_MAJOR=0
APP_VERSION_MINOR=1
APP_VERSION_BUILD=0
APP_VERSION_REVISION=1
APP_VERSION_CODENAME=silly
APP_VERSION_NICKNAME=package

function example {
    # Explains how documentation works

    $_e "I don't know what to do"
}

function colors {
    # Show color/style variable table

    $_e "Color/style variables:

    ${Cb}Cn${Cn}     ${Cn}Normal/reset${Cn}
    ${Cb}Cb${Cn}     ${Cb}Bold${Cn}
    ${Cb}Ci${Cn}     ${Ci}Italic${Cn}
    ${Cb}Cd${Cn}     ${Cd}Dark/gray${Cn}
    ${Cb}Cr${Cn}     ${Cr}Red${Cn}
    ${Cb}Cg${Cn}     ${Cg}Green${Cn}
    ${Cb}Cc${Cn}     ${Cc}Cian/Blue${Cn}
    ${Cb}Cy${Cn}     ${Cy}Yellow${Cn}"
}

function multi {
    # Try multi options (with helper)

    function one {
        #multi: Function one must return success
        success message "This returns success"

        [[ "$FAILURE" != "" ]] && fail "Fail message"
        success
    }

    function two {
        #multi: Function two must return success
        success message "This must return fail"

        fail "That will fail"

        success
    }

    # Ensure multilevel
    checkOptions "$@"
}



#
#       AVOID change above the safety line.
#
# -------------------------------------------------- SAFETY LINE ----

function show_header {
    TITLE="${Cb}${APP_TITLE}${Cn} v$(version print)"
    LABEL=$($_e -E "${TITLE}" | sed 's/\\[\e0-9]*\[[0-9;]*\m//g')

    $_e "\n\n$TITLE\n$(printf "%${#LABEL}s" | tr ' ' '-')\n"
}

function version {
    # Semantic versioning tool.

    function print {
        #version: Prints semantic version.

        TEXT="${APP_VERSION_MAJOR}"
        NICK="${APP_VERSION_CODENAME}"

        for O in \
        $APP_VERSION_MINOR \
        $APP_VERSION_BUILD
        do  [ ! -z "${O}" ] && \
            TEXT+=".${O}"
        done

        [ ! -z "${APP_VERSION_REVISION}" ] && TEXT+="-${APP_VERSION_REVISION}"
        [ ! -z "${APP_VERSION_NICKNAME}" ] && NICK+=" ${APP_VERSION_NICKNAME}"

        there '--no-nick' in $* || ([ ! -z "${NICK}" ] && TEXT+=" '${NICK}'")

        $_e "${TEXT}"
    }

    function check {
        #version: Check if current version matches last (actual) GIT tag.
        require git

        VERSION=$(version print --no-nick)
        GIT_TAG=$(git tag -l)

        success message "Não existe nenhuma TAG para a versão ${Cb}${VERSION}${Cn}."

        there $VERSION in $GIT_TAG && fail "A versão ${Cb}${VERSION}${Cn} já possui tag versionada."

        success
    }

    checkOptions "$@"
}

function there {
    SOMETHING=$1; shift; shift
    COLLECTION=$*

    [[ "${COLLECTION[@]}" =~ "${SOMETHING}" ]] && return 0

    return 1
}

function require {
    for required in $*
    do [ -z $(which "${required}") ] && fail "${Cb}${required}${Cn} required."
    done
}

SHORT=

declare -a commands
commands=()

{'fraction_non_alphanumeric': 0.19855821971477824, 'fraction_numerical': 0.0072089014261087605, 'mean_word_length': 2.257784583971414, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2297648', 'n_tokens_mistral': 2320, 'n_tokens_neox': 2188, 'n_words': 504}