Skip to content

feat: serve the PR comment status marks from /m/ - #105

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-plvb9l
Nov 20, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-plvb9l

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

The cpp-linter v2 PR comment redesign (cpp-linter/cpp-linter-rs#595) shows a status mark in the heading, in each row of the Tool table and on inline review comments. This adds the six marks to the site so that each <img> tag uses a short URL on the org's own domain:

Path Use Shown at
/m/hp.png /m/hw.png /m/hf.png heading: passed, warned, failed 24px
/m/p.png /m/w.png /m/f.png Tool table rows and inline review comments 20px

A full row mark tag is 85 bytes with https://cpp-linter.github.io/m/w.png, against 146 with a raw.githubusercontent.com URL. The images are drawn from the logo; the sources and make_marks.py, which rebuilds them from icon.png, live in cpp-linter/.github under branding/status/brush/.

marks

These are images only; no page or nav changes. Once deployed, #595 points at these URLs.

Related Issues

cpp-linter/cpp-linter-rs#595

cpp-linter v2 comments show these marks in headings, the Tool table and
inline review comments. A short path on the org site keeps every mark tag
small and keeps the images under the org's control. Sources and the
generator live in cpp-linter/.github branding/status/brush.
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cpp-linter-github-io ready!

Name Link
🔨 Latest commit 50e902c
🔍 Latest deploy log https://app.netlify.com/projects/cpp-linter-github-io/deploys/6b00c70a71129b09a536dab2
😎 Deploy Preview https://deploy-preview-105--cpp-linter-github-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@2bndy5

2bndy5 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Can we make the background black semi-transparent? It looks fine in dark theme, but the solid BG clashes in light theme.

@shenxianpeng

Copy link
Copy Markdown
Member Author

I tried it. A see-through black tile turns grey on a white page, and the amber and green go muddy on grey:

tile opacity

The solid tile is what makes the marks readable in light theme. Amber on white is about 1.6:1 contrast, on 50% grey about 2.4:1, and on the ink tile about 9.5:1. I'd keep it solid: it reads as a small badge, like an app icon.

@shenxianpeng

Copy link
Copy Markdown
Member Author

Let's adjust images if any are needed in a coming PR.

@shenxianpeng
shenxianpeng merged commit 78e0c77 into main Nov 20, 2026
7 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-plvb9l branch November 20, 2026 23:38
shenxianpeng added a commit to cpp-linter/cpp-linter-rs that referenced this pull request Nov 21, 2026
Everything cpp-linter posts on a pull request is seen by the author's
reviewers too, so it should read at a glance: the result first, then the
findings, then how to fix them. This redesigns the thread comment (and
step summary, which shares its renderer), the PR review, and the file
annotations for v2.

The screenshots below are the same demo code before and after, captured
from a real run in cpp-linter/test-cpp-linter-action#82.

## Before and after

| | Before | After |
|:--|:--|:--|
| Thread comment | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/1e8bd37/docs/docs/images/thread-comment-light.png"
width="400"> | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/731a3b3/docs/docs/images/thread-comment-light.png"
width="400"> |
| PR review | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/1e8bd37/docs/docs/images/pr-review-light.png"
width="400"> | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/731a3b3/docs/docs/images/pr-review-light.png"
width="400"> |
| Annotations in the diff | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/1e8bd37/docs/docs/images/annotations-diff-light.png"
width="400"> | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/a000db3/docs/docs/images/annotations-diff-light.png"
width="400"> |
| Annotations in the run | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/1e8bd37/docs/docs/images/annotations-summary-light.png"
width="400"> | <img
src="https://raw.githubusercontent.com/cpp-linter/cpp-linter-rs/a000db3/docs/docs/images/annotations-summary-light.png"
width="400"> |

Dark mode versions are in `docs/docs/images/*-dark.png`.

## What changed

**Status marks**
- The marks are drawn from the logo: "passed" is the logo itself, and
"warned" and "failed" keep its ring with a brush `!` or a red X that
breaks out of the ring's gap where the logo's check does. Headings use
the ringed mark at 24px; table rows and inline review comments use the
glyph alone at 20px. Each `<img>` has the glyph as `alt` text.
- They are served from the org site under a short path
(`https://cpp-linter.github.io/m/`,
cpp-linter/cpp-linter.github.io#105), so a mark tag is about 85 bytes.
`make_marks.py` in `branding/status/brush/` of cpp-linter/.github
rebuilds them from the logo.

**Thread comment and step summary**
- The heading states the result: `cpp-linter found 3 issues in 1 file`,
or `cpp-linter passed` with one line of versions and the number of files
checked.
- A Tool / Result table gives one row per tool, with the row's mark
inside the Tool cell (GitHub mobile shrinks a separate narrow mark
column). Then the clang-tidy findings as a table per file (line,
message, check link, "(fixable)"), then the files clang-format would
change, with their lines.
- A folded "How to fix" section gives the ways to fix in three short
lines: the exact `clang-format -i` command (scoped with `--lines` when
only changed lines are checked, so it never reformats untouched code),
the `fix-patch-path` output when this run wrote a patch, and a prompt to
give to a coding agent.
- When the comment would pass GitHub's size limit, it says how many
findings were left out instead of cutting text. Room for "How to fix" is
kept first, and the AI prompt lists 50 findings at most.
- File names and commands are relative to the repository root, also when
`--repo-root` is a subdirectory, so the commands work where the comment
says to run them.

**PR review**
- The heading mark is amber for warnings and red when a changed line has
an error or clang-format failed, like the thread comment. An error that
has nothing to post (no fix for that file) also keeps the review from
approving.
- The summary is one line: `2 comments (clang-format 21.1.8, clang-tidy
21.1.8)`, plus a sentence only when some findings fall outside the diff
or were already posted.
- Each inline comment starts with the mark, the severity and the linked
check name, then the message and the suggestion. The `path:line` header
and the copied code snippet are gone, since GitHub already shows both
right above the comment.

**Annotations**
- Titles are the check name (or `clang-format`), without repeating the
file and line.
- The clang-format annotation points at the first changed line instead
of line 0, says which lines differ, names the style (`the style in
.clang-format` instead of `Custom`), and gives the command to fix it.
- The Code Quality report uses the same style wording.

**Wording**
- No emoji and no `·` or `•` separators: the tables do the separating,
and the text uses commas and colons. The footer is `Powered by
cpp-linter | Feedback`.
- Counts agree with their nouns (`1 file`, `2 warnings`), and text from
clang is escaped so `*`, `|` or `<T>` can't break the Markdown.

## Notes for reviewers
- The step summary and `--summary-output-file` are written after the
patch and before the review is posted, so a failed review still leaves
the summary.
- Inline review comment bodies changed, so the first run after upgrading
will post new review comments instead of reusing the old ones.
- The step summary screenshots in the README were not reshot: GitHub
only shows step summaries to signed-in users. It renders the same
Markdown as the thread comment above.
- `main` (with the footer trim from #594) is merged into this branch.
The footer also drops its `---` rule: GitHub draws it with wide margins,
which left a large gap above the one grey "Powered by" line.

## Testing
- `cargo test --all-features` (lib, `comments` and `reviews` integration
tests) and `cargo clippy --all-features --all-targets` pass. A few lib
tests that set environment variables can fail when the whole lib suite
runs in one process; they pass on their own and fail the same way on
`main` (CI runs each test in its own process).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

## Summary

* **New Features**
* Review comments now include status indicators, concise summaries,
linked diagnostics, and relevant fix guidance.
* clang-format findings describe the configured style and identify
affected lines; clang-tidy findings include severity and diagnostic
details.
* Formatting commands can target changed lines, and long reports
indicate when findings are omitted.
  * Reviews can include generated patches when available.

* **Bug Fixes**
* Review summaries better distinguish errors, warnings, findings outside
the diff, and clean results.
* clang-tidy errors on changed lines are reported as failures, even when
no patched file is available.
  * Fix notices use clearer singular and plural wording.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants