<commit_before>#!/usr/bin/env python
import os

from flask.ext.script import Manager
from flask.ext.script.commands import ShowUrls, Clean
from flask.ext.migrate import MigrateCommand
from flask.ext.assets import ManageAssets

from config import AVAILABLE_CONFIGS, DEFAULT_CONFIG
from webapp import create_app

manager = Manager(create_app)
manager.add_option('-c', '--config', dest='config',
                   choices=AVAILABLE_CONFIGS.keys(), default=DEFAULT_CONFIG)
manager.add_command('urls', ShowUrls())
manager.add_command('clean', Clean())
manager.add_command('db', MigrateCommand)
manager.add_command("assets", ManageAssets())


@manager.command
def flake8():
    """Validates all Python source files using PEP8 and Pyflakes."""
    import flake8.main
    for dirpath, _, filenames in os.walk('.'):
        for filename in filenames:
            if (
                filename.endswith('.py') and
                not dirpath.endswith('/migrations/versions') and
                not dirpath.endswith('/migrations')
            ):
                flake8.main.check_file(
                    os.path.join(dirpath, filename))


if __name__ == '__main__':
    manager.run()<commit_msg>Touched up the docstring for the flake8 management command<commit_after>#!/usr/bin/env python
import os

from flask.ext.script import Manager
from flask.ext.script.commands import ShowUrls, Clean
from flask.ext.migrate import MigrateCommand
from flask.ext.assets import ManageAssets

from config import AVAILABLE_CONFIGS, DEFAULT_CONFIG
from webapp import create_app

manager = Manager(create_app)
manager.add_option('-c', '--config', dest='config',
                   choices=AVAILABLE_CONFIGS.keys(), default=DEFAULT_CONFIG)
manager.add_command('urls', ShowUrls())
manager.add_command('clean', Clean())
manager.add_command('db', MigrateCommand)
manager.add_command("assets", ManageAssets())


@manager.command
def flake8():
    """Validates all Python source files using Flake8"""
    import flake8.main
    for dirpath, _, filenames in os.walk('.'):
        for filename in filenames:
            if (
                filename.endswith('.py') and
                not dirpath.endswith('/migrations/versions') and
                not dirpath.endswith('/migrations')
            ):
                flake8.main.check_file(
                    os.path.join(dirpath, filename))


if __name__ == '__main__':
    manager.run()
{'fraction_non_alphanumeric': 0.11249481112494811, 'fraction_numerical': 0.0037359900373599006, 'mean_word_length': 3.2132867132867133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1711008', 'n_tokens_mistral': 726, 'n_tokens_neox': 698, 'n_words': 171}