def _find_or_create_output_view(window, target):
    """
    Find or create a view in the current window for putting the lint output in.
    This is used when lint_output_to_view is set to True to create the view for
    the lint results to be displayed in.
    """
    caption = {
        "package": "HyperHelpAuthor Lint: {pkg}",
        "single":  "HyperHelpAuthor Lint: {target} ({pkg})"
    }.get(target.target_type, "???").format(
        target=target.files[0],
        pkg=target.pkg_info.package)

    for view in window.views():
        if view.name().startswith("HyperHelpAuthor Lint"):
            view.set_name(caption)
            view.set_read_only(False)
            view.run_command("select_all")
            view.run_command("left_delete")
            return view

    view = window.new_file()
    view.set_name(caption)
    view.set_scratch(True)

    return view