Skip to content

Comments

Make DocumentationGenerator ignore trailing whitespace differences#942

Merged
meziantou merged 2 commits intomainfrom
copilot/update-documentation-generator
Dec 18, 2025
Merged

Make DocumentationGenerator ignore trailing whitespace differences#942
meziantou merged 2 commits intomainfrom
copilot/update-documentation-generator

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

The DocumentationGenerator exits with a non-zero code when generated content differs from existing files, breaking CI. Files with identical content except for trailing newlines/spaces were triggering unnecessary failures.

Change

Modified WriteFileIfChanged to use TrimEnd() when comparing existing and new content:

// Before
if (existingContent != content)

// After  
if (existingContent.TrimEnd() != content.TrimEnd())

This treats files as unchanged when they differ only in trailing whitespace (newlines, spaces, tabs), preventing spurious CI failures while preserving detection of actual content changes.

Original prompt

Can you make the DocumentationGenerator less strict when comparing new content with existing content. Sometimes it fails because a new line is missing at the end of the document, breaking the CI. Can you be more lax and handle this kind of differences


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Copilot AI changed the title [WIP] Update DocumentationGenerator to allow minor content variations Make DocumentationGenerator ignore trailing whitespace differences Dec 18, 2025
Copilot AI requested a review from meziantou December 18, 2025 06:08
@meziantou meziantou marked this pull request as ready for review December 18, 2025 14:28
@meziantou meziantou merged commit cef854c into main Dec 18, 2025
13 checks passed
@meziantou meziantou deleted the copilot/update-documentation-generator branch December 18, 2025 14:29
This was referenced Dec 18, 2025
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