Skip to content

fix: annotate only the changed lines - #31

Merged
dsherret merged 2 commits into
mainfrom
annotation_changed_lines
Sep 7, 2026
Merged

fix: annotate only the changed lines#31
dsherret merged 2 commits into
mainfrom
annotation_changed_lines

Conversation

@dsherret

@dsherret dsherret commented Sep 7, 2026

Copy link
Copy Markdown
Member

The annotation is shown beside the file on the pull request, so the surrounding lines are already visible.

  • The annotation now points at the first run of changed lines rather than the whole first hunk, so GitHub draws it next to the actual problem instead of after the trailing context lines.
  • The message lists only the changed lines, formatted as context-free hunks like diff -U0, with a blank line after the summary.
  • The line-endings-only detection reuses the same parsed changes instead of walking the diff a second time.

For example, on dprint/dprint#1247 the annotation moves from lines 8-14 to line 11 and becomes:

File is not formatted. Run `dprint fmt` to fix.

@@ -11 +11 @@
-##         GitHub Actions
+## GitHub Actions

@dsherret dsherret changed the title feat: annotate only the changed lines fix: annotate only the changed lines Sep 7, 2026
@dsherret
dsherret merged commit de1d638 into main Sep 7, 2026
14 checks passed
@dsherret
dsherret deleted the annotation_changed_lines branch September 7, 2026 14:59
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.

1 participant