fix(review): language-tagged suggestion fence for Gitea syntax highlighting
Gitea 1.26.x has no GitHub-style 'Apply suggestion' button — a ```suggestion fence is just an unknown-language code block, so chroma does not highlight it and there is no apply control. Switch inline_comment_body to wrap the suggested fix in a fence tagged with the file's language (new _lang_for_path helper, .java→java, .ts→typescript, .py→python, ...), so Gitea syntax-highlights the code. No capability lost (there was never an apply button on this Gitea version). Correct the docstrings/skills/README that wrongly claimed an apply-button was rendered. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -42,8 +42,10 @@ message — so the JSON must be the last thing, and it must be valid.
|
||||
- `suggestion` — the literal new code replacing the flagged line(s). Minimal,
|
||||
just the changed lines, indented as they appear in the file. **Empty string**
|
||||
when no safe textual replacement exists (missing test, architectural note, a
|
||||
fix that needs context beyond one hunk). This is wrapped in a ```suggestion
|
||||
fence → Gitea renders an **apply button**.
|
||||
fix that needs context beyond one hunk). The pilot wraps this in a fenced code
|
||||
block tagged with the file's language so Gitea syntax-highlights it. (Gitea
|
||||
1.26.x has no GitHub-style "Apply suggestion" button, so a ```suggestion fence
|
||||
is not used — a language-tagged fence gives highlighting and loses nothing.)
|
||||
- `reference` — a URL (CVE, library docs, spec) backing the finding, or `""`.
|
||||
Only link authoritative sources; don't fabricate URLs.
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ Each finding's `line` MUST be a line that exists in the POST-CHANGE version of
|
||||
Never anchor on a **removed** (`-`) line — it has no post-change line number.
|
||||
If you're unsure of the exact line, use the closest context line you CAN see in
|
||||
the diff. A misanchored finding becomes a summary bullet instead of an inline
|
||||
comment, so correct anchoring is what makes a ```suggestion apply-able in Gitea.
|
||||
comment, so correct anchoring is what gets a finding shown inline with its
|
||||
suggested-fix code block (language-highlighted) rather than demoted to a bullet.
|
||||
|
||||
## Honoring repo config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user