wpiformat/wpiformat/__init__.py
def filter_ignored_files(names):
    """Returns list of files not in .gitignore.

    Keyword arguments:
    names -- list of files to filter
    """
    # "git check-ignore" misbehaves when the names are separated by "\r\n" on
    # Windows, so os.linesep isn't used here.
    encoded_names = "\n".join(names).encode()

    proc = subprocess.run(
        ["git", "check-ignore", "--no-index", "-n", "-v", "--stdin"],
        input=encoded_names,
        stdout=subprocess.PIPE)
    if proc.returncode == 128:
        raise subprocess.CalledProcessError

    output_list = proc.stdout.decode().split("\n")

    # "git check-ignore" prefixes the names of non-ignored files with "::",
    # wraps names in quotes on Windows, and outputs "\n" line separators on all
    # platforms.
    return [
        name[2:].lstrip().strip("\"").replace("\\\\", "\\")
        for name in output_list
        if name[0:2] == "::"
    ]
Returns list of files not in .gitignore.

    Keyword arguments:
    names -- list of files to filter
    
Returns list of files not in .gitignore.
Keyword arguments:
names -- list of files to filter
Returns list of files not in . gitignore . Keyword arguments : names -- list of files to filter
def filter_ignored_files(names):
    encoded_names = "\n".join(names).encode()
    proc = subprocess.run(
        ["git", "check-ignore", "--no-index", "-n", "-v", "--stdin"],
        input=encoded_names,
        stdout=subprocess.PIPE)
    if proc.returncode == 128:
        raise subprocess.CalledProcessError
    output_list = proc.stdout.decode().split("\n")
    return [
        name[2:].lstrip().strip("\"").replace("\\\\", "\\")
        for name in output_list
        if name[0:2] == "::"
    ]
def filter_ignored_files ( names ) : encoded_names = "\n" . join ( names ) . encode ( ) proc = subprocess . run ( [ "git" , "check-ignore" , "--no-index" , "-n" , "-v" , "--stdin" ] , input = encoded_names , stdout = subprocess . PIPE ) if proc . returncode == 128 : raise subprocess . CalledProcessError output_list = proc . stdout . decode ( ) . split ( "\n" ) return [ name [ 2 : ] . lstrip ( ) . strip ( "\"" ) . replace ( "\\\\" , "\\" ) for name in output_list if name [ 0 : 2 ] == "::" ]
Returns list of files not in .gitignore.
Returns list of files not in . gitignore .
"""Returns list of files not in .gitignore.

    Keyword arguments:
    names -- list of files to filter
    """ # "git check-ignore" misbehaves when the names are separated by "\r\n" on # Windows, so os.linesep isn't used here. # "git check-ignore" prefixes the names of non-ignored files with "::", # wraps names in quotes on Windows, and outputs "\n" line separators on all # platforms.
names