You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two small feedback glitches: clang-format annotation has no line, clang-tidy rationale repeats in suggestions #566
@2bndy5 FYI. Two small things I noticed while making the README previews for #559. Both are cosmetic. I put them in one issue to keep the noise down, and I can send a PR for either.
1. The clang-format annotation is not anchored to a line
RestClient::make_annotations() creates the clang-format annotation with start_line: None. GitHub stores it at line 0 (this job: notice src/demo.cpp:0-0 Run clang-format on src/demo.cpp). So it shows up in the run's annotation list, but not in the "Files changed" diff next to the code, where the clang-tidy annotations are. v1 does the same.
Suggestion: anchor it to the first line that needs formatting (start_line = end_line = the first of the listed lines) and keep the full line list in the message. One annotation per file, as it is now, so it does not use up more of the annotation cap (#564).
2. The same rationale is listed once per fixed line in a review suggestion
TidyAdvice::get_suggestion_help() loops over note.fixed_lines and pushes the rationale for every fixed line inside the hunk. When one diagnostic's fix touches two lines of the same hunk, the comment lists it twice. Example (review comment, a braces fix that changes 2 lines):
### clang-tidy diagnostic(s)- statement should be inside braces [readability-braces-around-statements]- statement should be inside braces [readability-braces-around-statements]
Suggestion: add a note's rationale once if any of its fixed lines is in the hunk (fixed_lines.iter().any(...)), with its skipped-fix warnings once as well.
Sounds like it is doing as designed. the annotation does show in the "Changed Files" tab (just underneath the file's path). And there's really no context to add from clang-format output.
Sounds like desirable intuition, yeah, let's pursue it.
Activity
2bndy5 commentedon Nov 10, 2026