How to use the pep8.input_dir function in pep8

To help you get started, we’ve selected a few pep8 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magenta-aps / bibos_admin / admin_site / system / tests.py View on Github external
def do_test(self):
        arglist = ['--exclude=migrations', filepath]
        pep8.process_options(arglist)

        pep8.input_dir(filepath)
        output = pep8.get_statistics()
        # print "PEP8 OUTPUT: " + str(output)
        self.assertEqual(len(output), 0)
github praekelt / django-category / runtests.py View on Github external
def runpep8():
    # Hook into stdout.
    old_stdout = sys.stdout
    sys.stdout = mystdout = StringIO()

    # Run Pep8 checks.
    pep8.options, pep8.args = pep8.process_options()
    pep8.input_dir(MODULE)

    # Restore stdout.
    sys.stdout = old_stdout

    # Save result to pep8.txt.
    result = mystdout.getvalue()
    output = open('pep8.txt', 'w')
    output.write(result)
    output.close()

    # Return Pep8 result
    return result
github praekelt / django-setuptest / setuptest / runtests.py View on Github external
def runpep8(package):
    # Hook into stdout.
    old_stdout = sys.stdout
    sys.stdout = mystdout = StringIO()

    # Run Pep8 checks.
    pep8.options, pep8.args = pep8.process_options()
    pep8.options.repeat = True
    pep8.input_dir(package)

    # Restore stdout.
    sys.stdout = old_stdout

    # Save result to pep8.txt.
    result = mystdout.getvalue()
    output = open('pep8.txt', 'w')
    output.write(result)
    output.close()

    # Return Pep8 result
    if result:
        return result
    else:
        return None
github mkouhei / backup2swift / src / backup2swift_tests / test_pep8.py View on Github external
'--statistics',
                '--filename=*.py',
                '--show-source',
                '--benchmark',
                '--repeat',
                '--show-pep8',
                # '--qq',
                # '-v',
                BASE_DIR, ]

            options, args = pep8.process_options(arglist)
            runner = pep8.input_file

            for path in args:
                if os.path.isdir(path):
                    pep8.input_dir(path, runner=runner)
                elif not pep8.excluded(path):
                    options.counters['files'] += 1
                    runner(path)

            pep8.print_statistics()
            errors = pep8.get_count('E')
            warnings = pep8.get_count('W')
            message = 'pep8: %d errors / %d warnings' % (errors, warnings)
            print(message)
            assert errors + warnings == 0, message
github domogik / domogik / src / tools / run_pep8.py View on Github external
def main():
    """
    Parse options and run checks on Python source.
    """
    pep8.options = options()
    repo = dirname(dirname(abspath(__file__)))
    pep8.input_dir(repo)
github domogik / domogik / src / tools / run_pep8.py View on Github external
def main():
    """
    Parse options and run checks on Python source.
    """
    pep8.options = options()
    repo = dirname(dirname(abspath(__file__)))
    pep8.input_dir(repo)