Skip to content

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.

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
IhateTrains pushed a commit to ParadoxGameConverters/ImperatorToCK3 that referenced this pull request Dec 19, 2025
Updated
[Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer)
from 2.0.257 to 2.0.263.

<details>
<summary>Release notes</summary>

_Sourced from [Meziantou.Analyzer's
releases](https://github.com/meziantou/Meziantou.Analyzer/releases)._

## 2.0.263

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.263>

## What's Changed
* Add MA0180: Detect ILogger<T> type parameter mismatch with containing
class by @​Copilot in
meziantou/Meziantou.Analyzer#941


**Full Changelog**:
meziantou/Meziantou.Analyzer@2.0.262...2.0.263

## 2.0.262

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.262>

## What's Changed
* Make DocumentationGenerator ignore trailing whitespace differences by
@​Copilot in meziantou/Meziantou.Analyzer#942


**Full Changelog**:
meziantou/Meziantou.Analyzer@2.0.261...2.0.262

## 2.0.261

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.261>

## What's Changed
* Add MA0179: Detect inefficient attribute existence checks by @​Copilot
in meziantou/Meziantou.Analyzer#939


**Full Changelog**:
meziantou/Meziantou.Analyzer@2.0.260...2.0.261

## 2.0.260

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.260>

## What's Changed
* Add concurrency control to serialize CI runs on main branch by
@​Copilot in meziantou/Meziantou.Analyzer#938


**Full Changelog**:
meziantou/Meziantou.Analyzer@2.0.259...2.0.260

## 2.0.259

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.259>

## What's Changed
* Add opt-in configuration for MA0153 to detect logging of types
containing DataClassification members by @​Copilot in
meziantou/Meziantou.Analyzer#936


**Full Changelog**:
meziantou/Meziantou.Analyzer@2.0.258...2.0.259

## 2.0.258

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.258>

**Full Changelog**:
meziantou/Meziantou.Analyzer@2.0.257...2.0.258

Commits viewable in [compare
view](meziantou/Meziantou.Analyzer@2.0.257...2.0.263).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Meziantou.Analyzer&package-manager=nuget&previous-version=2.0.257&new-version=2.0.263)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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