<commit_before># Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).

from fabric.api import env, hide, local, settings, task
from fabric.colors import green, red, yellow
from fabric.contrib.console import confirm
from os.path import abspath, dirname, join
from utils import git

env.huxley_root = abspath(dirname(dirname(__file__)))

@task
def feature(branch_name=None):
    '''Create a new feature branch.'''
    if not branch_name:
        print red('No branch name given. Usage: fab feature:<branch_name>')
        return
    git.new_branch(branch_name)

@task
def update():
    '''Rebase the current feature branch onto the latest version of upstream.'''
    print 'Updating your local branch...'
    git.pull()

@task
def test(*args):
    '''Run the project's test suite, with optionally specified apps.'''
    with hide('aborts', 'warnings'):
        return local('python manage.py test %s' % ' '.join(args))

@task
def authors():
    '''Update the AUTHORS file.'''
    authors = join(env.huxley_root, 'AUTHORS')
    with hide('running'):
        local('git log --format="%aN <%aE>" | sort -u > {0}'.format(authors))
        if local('git diff --name-only AUTHORS', capture=True):
            print green('Automatically updating the authors file...')
            local('git commit -m "Update AUTHORS." {0}'.format(authors))

@task
def submit(remote='origin', skip_tests=False):
    '''Push the current feature branch and create/update pull request.'''
    if not skip_tests:
        with settings(warn_only=True):
            if test().failed:
                if confirm(yellow('Tests failed. Continue anyway?')):
                    print yellow('Ignoring failed tests. Be careful.')
                else:
                    print red('Terminating due to failed tests.')
                    return
            else:
                print green('Tests OK!')
<commit_msg>Add skip message to 'fab authors'.<commit_after># Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).

from fabric.api import env, hide, local, settings, task
from fabric.colors import green, red, yellow
from fabric.contrib.console import confirm
from os.path import abspath, dirname, join
from utils import git

env.huxley_root = abspath(dirname(dirname(__file__)))

@task
def feature(branch_name=None):
    '''Create a new feature branch.'''
    if not branch_name:
        print red('No branch name given. Usage: fab feature:<branch_name>')
        return
    git.new_branch(branch_name)

@task
def update():
    '''Rebase the current feature branch onto the latest version of upstream.'''
    print 'Updating your local branch...'
    git.pull()

@task
def test(*args):
    '''Run the project's test suite, with optionally specified apps.'''
    with hide('aborts', 'warnings'):
        return local('python manage.py test %s' % ' '.join(args))

@task
def authors():
    '''Update the AUTHORS file.'''
    authors = join(env.huxley_root, 'AUTHORS')
    with hide('running'):
        local('git log --format="%aN <%aE>" | sort -u > {0}'.format(authors))
        if local('git diff --name-only AUTHORS', capture=True):
            print green('Automatically updating the authors file...')
            local('git commit -m "Update AUTHORS." {0}'.format(authors))
        else:
            print green('No change to AUTHORS.')

@task
def submit(remote='origin', skip_tests=False):
    '''Push the current feature branch and create/update pull request.'''
    if not skip_tests:
        with settings(warn_only=True):
            if test().failed:
                if confirm(yellow('Tests failed. Continue anyway?')):
                    print yellow('Ignoring failed tests. Be careful.')
                else:
                    print red('Terminating due to failed tests.')
                    return
            else:
                print green('Tests OK!')

{'fraction_non_alphanumeric': 0.12090367428003972, 'fraction_numerical': 0.004965243296921549, 'mean_word_length': 2.829847908745247, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4510668', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1089, 'n_words': 403}