Skip to content

feat: summarize diffs that only change line endings - #29

Merged
dsherret merged 1 commit into
mainfrom
feat/summarize-line-ending-diffs
Sep 6, 2026
Merged

feat: summarize diffs that only change line endings#29
dsherret merged 1 commit into
mainfrom
feat/summarize-line-ending-diffs

Conversation

@dsherret

@dsherret dsherret commented Sep 6, 2026

Copy link
Copy Markdown
Member

With --json (used when annotations are enabled), dprint defaults to the unified diff format, which doesn't have the "Text differed by line endings." shortcut that the pretty format has. So a CRLF checkout on Windows produced a full diff of every line in every file, each with a \r marker, plus an annotation spanning the whole file.

This makes the annotate script detect when a diff only changes line endings and:

  • print "Text differed by line endings." instead of the diff, matching dprint's plain output
  • point the annotation at line 1 instead of highlighting the whole file
  • when running on a Windows runner and the checked out file had CRLF line endings, add a hint to the annotation recommending only running the action on Linux, with a link to the README's Windows line endings section

A file that only gains a final newline is still shown as a full diff, since that's a real change rather than a line ending one.

@dsherret
dsherret merged commit fe900a7 into main Sep 6, 2026
14 checks passed
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