How to use the pycodestyle._main function in pycodestyle

To help you get started, we’ve selected a few pycodestyle 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 PyCQA / pycodestyle / testsuite / test_shell.py View on Github external
def pycodestyle(self, *args):
        del sys.stdout[:], sys.stderr[:]
        sys.argv[1:] = args
        try:
            pycodestyle._main()
            errorcode = None
        except SystemExit:
            errorcode = sys.exc_info()[1].code
        return sys.stdout.getvalue(), sys.stderr.getvalue(), errorcode
github Parallels / githooks / hooks.d / pycheck / pycodestyle / testsuite / test_shell.py View on Github external
def pep8(self, *args):
        del sys.stdout[:], sys.stderr[:]
        sys.argv[1:] = args
        try:
            pycodestyle._main()
            errorcode = None
        except SystemExit:
            errorcode = sys.exc_info()[1].code
        return sys.stdout.getvalue(), sys.stderr.getvalue(), errorcode
github twisted / twisted / admin / pycodestyle-twisted.py View on Github external
"class or function definition, found %d" % (
                top_level_lines, blank_before)



# Replace the upstream blank_lines implementation, with our fork.
_previousValue = pycodestyle._checks['logical_line'][pycodestyle.blank_lines]
del pycodestyle._checks['logical_line'][pycodestyle.blank_lines]
pycodestyle._checks['logical_line'][blank_lines] = _previousValue



if __name__ == '__main__':
    # Calling main in a similar was as the upstream script.
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(pycodestyle._main())