Skip to main content

render_markdown

Function render_markdown 

Source
pub fn render_markdown(report: &Report, max_lines: usize) -> String
Expand description

Renders the report as a Markdown comment for pull requests.

§Arguments

  • report - The coverage report to render.
  • max_lines - Maximum number of uncovered lines to show in the table (default 10).

§Returns

A Markdown-formatted string suitable for a PR comment.

§Example Output

## covguard: Diff Coverage Report

**Status**: [emoji] [status]

### Summary
- **Diff coverage**: X.X%
- **Changed lines**: N
- **Covered**: N
- **Uncovered**: N

### Uncovered Lines

| File | Line | Hits |
|------|------|------|
| src/lib.rs | 1 | 0 |

*Showing N of M uncovered lines*

<details>
<summary>Reproduce locally</summary>

```bash
covguard check --diff-file <file> --lcov <lcov>
```

`</details>`