Skip to content

Add a script to validate & fix mismatches CRLF in the repo - #40933

Merged
Blue (OneBlue) merged 5 commits into
masterfrom
user/oneblue/crlf
Jun 29, 2026
Merged

Blue (OneBlue) merged 5 commits into
masterfrom
user/oneblue/crlf

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds a script that blocks merging a change with mismatches CRLF in code files. clang-format does some of it, but it doesn't cover all files.

The files can be fixed via python tools/devops/validate-line-endings.py . --fix

This will prevent needless git conflicts and copilot getting confused

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings June 27, 2026 00:05
@OneBlue
Blue (OneBlue) requested a review from a team as a code owner June 27, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a repo validation script intended to detect (and optionally fix) non-CRLF line endings in tracked source files, and wires it into CI to prevent line-ending churn and merge conflicts.

Changes:

  • Added tools/devops/validate-line-endings.py to detect line-ending mismatches and optionally normalize files to CRLF.
  • Updated the build pipeline checks stage to run a line-ending validation step (intended).

Reviewed changes

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

File Description
tools/devops/validate-line-endings.py New Python validator to detect/fix non-CRLF line endings for selected tracked source files.
.pipelines/build-stage.yml Adds a CI “line feeds” check step (currently wired to the wrong script).
Comment thread .pipelines/build-stage.yml Outdated
Comment thread tools/devops/validate-line-endings.py Outdated
Comment thread tools/devops/validate-line-endings.py
Comment thread tools/devops/validate-line-endings.py Outdated
Copilot AI review requested due to automatic review settings June 29, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .pipelines/build-stage.yml Outdated
Comment thread .pipelines/build-stage.yml Outdated
Comment thread tools/devops/validate-line-endings.py
@florelis

Copy link
Copy Markdown
Member

Wouldn't it be easier to add a .gitattributes and renormalize everything?

@OneBlue

Copy link
Copy Markdown
Collaborator Author

Wouldn't it be easier to add a .gitattributes and renormalize everything?

I think a .gitattributes would be a good idea, although my understanding is that this would not actually enforce that the line endings are correct so I'd still want the pipeline to enforce it.

@OneBlue
Blue (OneBlue) merged commit 1c175ec into master Jun 29, 2026
11 checks passed
@OneBlue
Blue (OneBlue) deleted the user/oneblue/crlf branch June 29, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants