usort/cli.py
def diff(ctx: click.Context, filenames: List[str]) -> int:
    """
    Output diff of changes for one or more path
    """
    if not filenames:
        raise click.ClickException("Provide some filenames")

    return_code = 0
    for f in filenames:
        path = Path(f)
        for result in usort_path(path, write=False):
            if result.error:
                click.echo(f"Error sorting {result.path}: {result.error}")
                if ctx.obj.debug:
                    click.echo(result.trace)
                return_code |= 1
                continue

            for warning in result.warnings:
                click.echo(f"Warning at {result.path}:{warning.line} {warning.message}")

            if result.content != result.output:
                assert result.encoding is not None
                echo_color_unified_diff(
                    result.content.decode(result.encoding),
                    result.output.decode(result.encoding),
                    result.path.as_posix(),
                )

            print_benchmark(result.timings)

    return return_code

    Output diff of changes for one or more path
    
Output diff of changes for one or more path
Output diff of changes for one or more path
def diff(ctx: click.Context, filenames: List[str]) -> int:
    if not filenames:
        raise click.ClickException("Provide some filenames")
    return_code = 0
    for f in filenames:
        path = Path(f)
        for result in usort_path(path, write=False):
            if result.error:
                click.echo(f"Error sorting {result.path}: {result.error}")
                if ctx.obj.debug:
                    click.echo(result.trace)
                return_code |= 1
                continue
            for warning in result.warnings:
                click.echo(f"Warning at {result.path}:{warning.line} {warning.message}")
            if result.content != result.output:
                assert result.encoding is not None
                echo_color_unified_diff(
                    result.content.decode(result.encoding),
                    result.output.decode(result.encoding),
                    result.path.as_posix(),
                )
            print_benchmark(result.timings)
    return return_code
def diff ( ctx : click . Context , filenames : List [ str ] ) -> int : if not filenames : raise click . ClickException ( "Provide some filenames" ) return_code = 0 for f in filenames : path = Path ( f ) for result in usort_path ( path , write = False ) : if result . error : click . echo ( f"Error sorting {result.path}: {result.error}" ) if ctx . obj . debug : click . echo ( result . trace ) return_code |= 1 continue for warning in result . warnings : click . echo ( f"Warning at {result.path}:{warning.line} {warning.message}" ) if result . content != result . output : assert result . encoding is not None echo_color_unified_diff ( result . content . decode ( result . encoding ) , result . output . decode ( result . encoding ) , result . path . as_posix ( ) , ) print_benchmark ( result . timings ) return return_code
Output diff of changes for one or more path
Output diff of changes for one or more path
"""
    Output diff of changes for one or more path
    """
ctx
click.Context
filenames
List[str]