wpiformat/wpiformat/__init__.py
def proc_pipeline(name):
    """Runs the contents of each file through the task pipeline.

    If the contents were modified at any point, the result is written back out
    to the file.

    Keyword arguments:
    name -- file name string
    """
    config_file = Config(os.path.dirname(name), ".styleguide")
    if verbose1 or verbose2:
        with print_lock:
            print("Processing", name)
            if verbose2:
                print("  with config " + config_file.file_name)
                for subtask in task_pipeline:
                    if subtask.should_process_file(config_file, name):
                        print("  with " + type(subtask).__name__)

    lines = ""
    with open(name, "r", encoding="utf8") as file:
        try:
            lines = file.read()
        except UnicodeDecodeError:
            print(
                f"error: {name} contains characters not in UTF-8. Should this be considered a generated file?"
            )
            return False

    # The success flag is aggregated across multiple file processing results
    all_success = True

    output = lines
    for subtask in task_pipeline:
        if subtask.should_process_file(config_file, name):
            output, success = subtask.run_pipeline(config_file, name, output)
            all_success &= success

    if lines != output:
        with open(name, "wb") as file:
            file.write(output.encode())

    return all_success
Runs the contents of each file through the task pipeline.

    If the contents were modified at any point, the result is written back out
    to the file.

    Keyword arguments:
    name -- file name string
    
Runs the contents of each file through the task pipeline.
If the contents were modified at any point, the result is written back out
to the file.

Keyword arguments:
name -- file name string
Runs the contents of each file through the task pipeline . If the contents were modified at any point the result is written back out to the file . Keyword arguments : name -- file name string
def proc_pipeline(name):
    config_file = Config(os.path.dirname(name), ".styleguide")
    if verbose1 or verbose2:
        with print_lock:
            print("Processing", name)
            if verbose2:
                print("  with config " + config_file.file_name)
                for subtask in task_pipeline:
                    if subtask.should_process_file(config_file, name):
                        print("  with " + type(subtask).__name__)
    lines = ""
    with open(name, "r", encoding="utf8") as file:
        try:
            lines = file.read()
        except UnicodeDecodeError:
            print(
                f"error: {name} contains characters not in UTF-8. Should this be considered a generated file?"
            )
            return False
    all_success = True
    output = lines
    for subtask in task_pipeline:
        if subtask.should_process_file(config_file, name):
            output, success = subtask.run_pipeline(config_file, name, output)
            all_success &= success
    if lines != output:
        with open(name, "wb") as file:
            file.write(output.encode())
    return all_success
def proc_pipeline ( name ) : config_file = Config ( os . path . dirname ( name ) , ".styleguide" ) if verbose1 or verbose2 : with print_lock : print ( "Processing" , name ) if verbose2 : print ( "  with config " + config_file . file_name ) for subtask in task_pipeline : if subtask . should_process_file ( config_file , name ) : print ( "  with " + type ( subtask ) . __name__ ) lines = "" with open ( name , "r" , encoding = "utf8" ) as file : try : lines = file . read ( ) except UnicodeDecodeError : print ( f"error: {name} contains characters not in UTF-8. Should this be considered a generated file?" ) return False all_success = True output = lines for subtask in task_pipeline : if subtask . should_process_file ( config_file , name ) : output , success = subtask . run_pipeline ( config_file , name , output ) all_success &= success if lines != output : with open ( name , "wb" ) as file : file . write ( output . encode ( ) ) return all_success
Runs the contents of each file through the task pipeline.
Runs the contents of each file through the task pipeline .
"""Runs the contents of each file through the task pipeline.

    If the contents were modified at any point, the result is written back out
    to the file.

    Keyword arguments:
    name -- file name string
    """ # The success flag is aggregated across multiple file processing results
name