Skip to content

⚙️ [Maintenance]: Documentation index checks now work across line endings - #79

Merged
Marius Storhaug (MariusStorhaug) merged 3 commits into
mainfrom
fix-index-line-endings
Jul 25, 2026
Merged

⚙️ [Maintenance]: Documentation index checks now work across line endings#79
Marius Storhaug (MariusStorhaug) merged 3 commits into
mainfrom
fix-index-line-endings

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 25, 2026

Copy link
Copy Markdown
Member

Documentation index checks now behave consistently across Windows and Linux working copies, avoiding false stale-index failures caused only by checkout line endings.

Fixed: Index checks no longer depend on checkout line endings

Current generated indexes pass validation with either LF or CRLF line endings. Real table-content drift still fails validation, and update mode retains one consistent existing newline style for the file.

Technical Details

  • Normalizes line endings only for content comparison while rendering with the newline sequence detected from each existing index.
  • Adds six focused Pester cases covering unchanged, stale, and updated LF and CRLF inputs.
  • Preserves byte-for-byte content when an index is already current.
  • Implementation plan progress: all line-ending behavior and validation tasks in Make documentation index checks line-ending agnostic #78 are complete.
Related issues

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation index generation/check script to make “stale index” detection independent of the checkout’s LF vs CRLF line endings, preventing false CI failures across Windows/Linux working copies.

Changes:

  • Normalize line endings only for comparison when determining whether an index is stale, while preserving the index file’s existing newline style when rendering/writing.
  • Update index table generation to join lines using the detected newline sequence instead of forcing LF.
  • Add Pester tests covering unchanged, stale, and repaired indexes under both LF and CRLF fixtures.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/Update-DocumentationIndex.Tests.ps1 Adds fixture-based Pester coverage for LF/CRLF behavior in both -Check and update modes.
.github/scripts/Update-DocumentationIndex.ps1 Detects and preserves per-file newline style while comparing content in a newline-normalized form to avoid false stale detections.

@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review July 25, 2026 16:26
@MariusStorhaug
Marius Storhaug (MariusStorhaug) merged commit 4c84b31 into main Jul 25, 2026
20 checks passed
@MariusStorhaug
Marius Storhaug (MariusStorhaug) deleted the fix-index-line-endings branch July 25, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NoRelease No release required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make documentation index checks line-ending agnostic

2 participants