Declare workflow YAML as LF and validate line endings in CI - #250
Merged
Conversation
Dependabot and Actions rewrite workflow files with LF, which mixes them against the CRLF default and recurs on every bump. Declare .github/workflows/*.{yml,yaml} as LF in .editorconfig so all writers agree - no more mixing - and convert the existing workflow files to LF (content unchanged). git still leaves endings alone (* -text is unchanged); nothing is renormalized fleet-wide. Add editorconfig-checker (EOL-only, via .editorconfig-checker.json) to the lint gate so a genuine EOL/editorconfig mismatch is caught in a PR - it passes on Dependabot LF workflows and fires only on a real violation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to stop recurring workflow YAML line-ending drift by explicitly declaring LF for .github/workflows/*.{yml,yaml} in .editorconfig, converting existing workflow files to LF, and adding a CI gate (editorconfig-checker) to validate .editorconfig compliance.
Changes:
- Declare workflow YAML as LF via a dedicated
.editorconfigsection for.github/workflows/*.{yml,yaml}. - Add an editorconfig-checker Docker-based CI step to verify line endings (and related EditorConfig rules per config).
- Introduce
.editorconfig-checker.jsonto scope which checks editorconfig-checker enforces.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/test-pull-request.yml | Adds editorconfig-checker step to validate .editorconfig compliance in CI. |
| .github/workflows/publish-release.yml | Line-ending normalization to LF (content-neutral). |
| .github/workflows/merge-bot-pull-request.yml | Line-ending normalization to LF (content-neutral). |
| .editorconfig-checker.json | Configures editorconfig-checker to limit which checks are enforced. |
| .editorconfig | Declares workflow YAML as LF to prevent mixed-EOL churn in .github/workflows/. |
…w-LF rule Drop the redundant 'ec' argument (the image's default command already runs the checker). Disable the Charset check so editorconfig-checker is EOL-only as intended. Update AGENTS.md so the line-ending governance states that workflow YAML is LF (editorconfig + CI, not a .gitattributes pin) while other YAML stays CRLF. Addresses Copilot review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reference .github/workflows/*.{yml,yaml} (one directory level, as GitHub runs workflows and as .editorconfig pins) rather than the recursive **. Addresses Copilot review.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ptr727
added a commit
that referenced
this pull request
Jul 7, 2026
Encode that non-executed pattern files stay CRLF: `.dockerignore` and `.gitignore` are consumed by Linux tools, but their parsers strip a trailing CR, so only an interpreted Dockerfile (a CR breaks RUN heredocs and line continuations) is LF (AGENTS.md). Pin the catalog snippet workflows to LF in `.editorconfig` and convert them, so a copied snippet lands compliant with the workflow-YAML-LF rule instead of needing conversion. Note the workflow-YAML LF pin in the spec's `recurring.eol` assertion, which #250 left listing only the shell, Dockerfile, and shebang-`.py` pins. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ptr727
added a commit
that referenced
this pull request
Jul 7, 2026
…251) Three line-ending governance completions: - **AGENTS.md** — encode that non-executed pattern files stay CRLF: `.dockerignore`/`.gitignore` parsers strip a trailing CR, so only an interpreted Dockerfile is LF. (Corrects a misclassification from the fleet rollout where `.dockerignore` was wrongly LF-pinned.) - **`.editorconfig`** — pin `catalog/snippets/workflows/*.{yml,yaml}` to LF and convert the 11 snippets, so a copied snippet lands compliant with the workflow-YAML-LF rule. - **spec `recurring.eol`** — add the workflow-YAML LF pin to the assertion (#250 left it listing only the older pins). EOL-preserving; `git diff --ignore-cr-at-eol` shows only these three content changes plus the snippet conversions. ec, jq, validate.py, markdownlint, cspell all clean locally. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
ptr727
added a commit
that referenced
this pull request
Jul 7, 2026
Two-phase promotion of the accumulated governance work on `develop` to `main`. Carries #244-#251: - #244 Foundational Principles (the model's governing *why*) - #245 Replace the mypy ban with a strong-typing policy - #246 aiopurpleair + homeassistant-purpleair audit reports - #247 Catalog the 14 backlog repos; add the `eda` type and `releaseTrigger: none` - #248 Branch-conditional Docker platforms (multi-arch main, amd64 elsewhere) - #249 Retire the both-branch matrix for symmetric single-branch self-release - #250 Declare workflow YAML as LF and validate line endings in CI - #251 Extend line-ending governance to pattern files and catalog snippets All commits were reviewed and CI-green on their individual develop PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The durable fix for the recurring workflow-EOL whack-a-mole, per your approach.
.editorconfig:[.github/workflows/*.{yml,yaml}] end_of_line = lf. Dependabot/Actions write LF, so declaring LF means they agree - no more mixed files - without git touching endings (.gitattributes: * -textis unchanged; nothing is renormalized). Other YAML and all.csproj/pyproject.toml/lock files stay CRLF (verified: only workflow YAML drifts).editorconfig-checker(EOL-only,.editorconfig-checker.json) to the lint gate. It passes on Dependabot LF workflows and fires only on a genuine editorconfig mismatch - the validation you wanted, now usable.Reference for the fleet; per-repo rollout follows. Supersedes the closed CRLF-normalize PRs.