def pretty_grep_to_str(grep_result, haystack, ignore=None):
    """
    Returns a str containing the grep results without the ignored paths

    :param dict grep_result: the result of a pretty_grep call
    :param str haystack: the base path of the grrp haystack
    :param list ignore: a list of str with paths to be ignored
    :return: a pretty str with the grep results
    """
    if not ignore:
        ignore = []

    final_str = ""
    for filename in grep_result:

        # bypass ignored paths
        if any([ignore_path in filename for ignore_path in ignore]):
            continue

        final_str = "{}\n* {}".format(final_str, filename.replace(haystack, ""))

        # sort the results by line
        for result in sorted(
            grep_result[filename], key=lambda k: int(k["line"])):
            final_str = "{}\n * Line {}: {}".format(final_str, result["line"],
                result["details"])

    return final_str