def report()

in bot/code_coverage_bot/grcov.py [0:0]


def report(artifacts, source_dir=None, out_format="covdir", options=[]):
    assert out_format in (
        "covdir",
        "files",
        "lcov",
        "coveralls+",
    ), "Unsupported output format"
    cmd = ["grcov", "-t", out_format]

    # Coveralls+ is only needed for zero-coverage reports
    if out_format == "coveralls+":
        cmd.extend(["--token", "unused"])

    if source_dir is not None:
        cmd.extend(["-s", source_dir])
        cmd.append("--ignore-not-existing")

    cmd.extend(artifacts)
    cmd.extend(options)

    try:
        return run_check(cmd)
    except Exception:
        logger.error("Error while running grcov")
        raise