예제 #1
0
def _validate_pythontidy(fd):
    source = StringIO(fd.read())
    if len(source.getvalue()) < 4:
        # small or empty files are ignored
        return True
    formatted = StringIO()
    PythonTidy.tidy_up(source, formatted)
    return source.getvalue() == formatted.getvalue()
예제 #2
0
def _validate_pythontidy(fd):
    if is_python3(fd) or running_on_py3:
        # PythonTidy supports Python 2 only
        return True
    source = StringIO(fd.read())
    if len(source.getvalue()) < 4:
        # small or empty files are ignored
        return True
    formatted = StringIO()
    PythonTidy.tidy_up(source, formatted)
    return source.getvalue() == formatted.getvalue()
예제 #3
0
def _validate_pythontidy(fd):
    if is_python3(fd):
        # PythonTidy supports Python 2 only
        return True
    source = StringIO(fd.read())
    if len(source.getvalue()) < 4:
        # small or empty files are ignored
        return True
    formatted = StringIO()
    PythonTidy.tidy_up(source, formatted)
    return source.getvalue() == formatted.getvalue()
예제 #4
0
def _fix_pythontidy(src, dst):
    PythonTidy.tidy_up(src, dst)
예제 #5
0
def _fix_pythontidy(src, dst):
    PythonTidy.tidy_up(src, dst)