(
    paths: Union[List, str],
    exclusion_regexes: Set[re.Pattern],
    recursive: bool,
    ignore_git: bool,
)
return targets
Retrieve the filepaths from the command.

    :param paths: List of file/dir paths from the command
    :param recursive: Recursive option
    :param ignore_git: Ignore that the folder is a git repository
    :raise: click.FileError if directory is given without --recursive option
Retrieve the filepaths from the command.
Retrieve the filepaths from the command .
def get_filepaths(
    paths: Union[List, str],
    exclusion_regexes: Set[re.Pattern],
    recursive: bool,
    ignore_git: bool,
) -> Set[str]:
    """
    Retrieve the filepaths from the command.

    :param paths: List of file/dir paths from the command
    :param recursive: Recursive option
    :param ignore_git: Ignore that the folder is a git repository
    :raise: click.FileError if directory is given without --recursive option
    """
    targets = set()
    for path in paths:
        if os.path.isfile(path):
            targets.add(path)
        elif os.path.isdir(path):
            if not recursive:
                raise click.FileError(
                    click.format_filename(path), "Use --recursive to scan directories."
                )
            top_dir = Path(path)

            if is_git_dir(path) and not ignore_git:
                _targets = {os.path.join(path, target) for target in git_ls(path)}
            else:
                _targets = {str(target) for target in top_dir.rglob(r"*")}

            for file_path in _targets:
                if not is_filepath_excluded(file_path, exclusion_regexes):
                    targets.add(file_path)
    return targets
def get_filepaths ( paths : Union [ List , str ] , exclusion_regexes : Set [ re . Pattern ] , recursive : bool , ignore_git : bool , ) -> Set [ str ] : targets = set ( ) for path in paths : if os . path . isfile ( path ) : targets . add ( path ) elif os . path . isdir ( path ) : if not recursive : raise click . FileError ( click . format_filename ( path ) , "Use --recursive to scan directories." ) top_dir = Path ( path ) if is_git_dir ( path ) and not ignore_git : _targets = { os . path . join ( path , target ) for target in git_ls ( path ) } else : _targets = { str ( target ) for target in top_dir . rglob ( r"*" ) } for file_path in _targets : if not is_filepath_excluded ( file_path , exclusion_regexes ) : targets . add ( file_path ) return targets