Skip to content

Declare workflow YAML as LF and validate line endings in CI - #250

Merged
ptr727 merged 3 commits into
developfrom
feature/workflow-eol-lf
Jul 6, 2026
Merged

Declare workflow YAML as LF and validate line endings in CI#250
ptr727 merged 3 commits into
developfrom
feature/workflow-eol-lf

Conversation

@ptr727

@ptr727 ptr727 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

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: * -text is unchanged; nothing is renormalized). Other YAML and all .csproj/pyproject.toml/lock files stay CRLF (verified: only workflow YAML drifts).
  • Convert the hub workflow files CRLF->LF (content-neutral).
  • CI: add 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.

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>
Copilot AI review requested due to automatic review settings July 6, 2026 18:19

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

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 .editorconfig section 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.json to 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/.

Comment thread .github/workflows/test-pull-request.yml Outdated
Comment thread .editorconfig-checker.json
Comment thread .editorconfig
…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>

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 4 out of 6 changed files in this pull request and generated 1 comment.

Comment thread AGENTS.md Outdated
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>

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 4 out of 6 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 556157a into develop Jul 6, 2026
7 checks passed
@ptr727
ptr727 deleted the feature/workflow-eol-lf branch July 6, 2026 18:34
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>
@ptr727 ptr727 mentioned this pull request Jul 7, 2026
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.
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