def git_hook(error=True):
    """Run pylama after git commit."""
    _, files_modified, _ = run("git diff-index --cached --name-only HEAD")

    options = parse_options()
    setup_logger(options)
    if sys.version_info >= (3,):
        candidates = [f.decode('utf-8') for f in files_modified]
    else:
        candidates = [str(f) for f in files_modified]

    if candidates:
        process_paths(options, candidates=candidates, error=error)
def git_hook ( error = True ) : _ , files_modified , _ = run ( "git diff-index --cached --name-only HEAD" ) options = parse_options ( ) setup_logger ( options ) if sys . version_info >= ( 3 , ) : candidates = [ f . decode ( 'utf-8' ) for f in files_modified ] else : candidates = [ str ( f ) for f in files_modified ] if candidates : process_paths ( options , candidates = candidates , error = error )
Run pylama after git commit.