Skip to content

Refine line-ending policy, default Python to CRLF, add runbook notes - #229

Merged
ptr727 merged 3 commits into
developfrom
feature/line-ending-and-runbook-rules
Jul 5, 2026
Merged

Refine line-ending policy, default Python to CRLF, add runbook notes#229
ptr727 merged 3 commits into
developfrom
feature/line-ending-and-runbook-rules

Conversation

@ptr727

@ptr727 ptr727 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Encodes the validated, non-conflicting slice of retrospective #228, plus a line-ending policy refinement.

  • Line-ending policy (§1). Reconcile the AGENTS.md Line Endings section with the merged [*] end_of_line = crlf default + LF-exceptions policy (it previously prescribed the old full-per-extension form and warned against the minimal form). Default .py to CRLF - Python's universal newlines accept CRLF, so it imports/runs/compiles identically on every OS, and .py is commonly edited on Windows where a blanket LF pin only caused LF<->CRLF save-churn. Pin LF by path for a .py executed directly via its shebang (spec/validate.py, the CI validation entry point), treating it like a shell script; drop the blanket *.py text eol=lf. This revises Retrospective: cross-platform, dev-tooling & agent-workflow learnings to encode as rules #228 §1's blanket [*.py] = lf.
  • EOL-audit method (§1). Byte-scan (CRLF-only / LF-only / mixed) rather than trusting file or naive git ls-files --eol parsing; scope audits to git ls-files (+ --others --exclude-standard); multi-line / new-file edits into a CRLF file must emit CRLF; .code-workspace is JSONC.
  • gh / Copilot runbook (§5). Add a "PR Edits and Merge-State Gotchas" subsection: gh pr edit is broken by the Projects-classic deprecation (use updatePullRequest / REST PATCH); main/develop use rulesets, not classic protection (BLOCKED is usually unresolved threads); the push -> head-SHA read race; Copilot findings can be factually wrong.
  • Pre-commit (§8). Add a Git rule to check the maintainer's uncommitted working-tree edits before committing.

First of several scoped slices (per #228's own sprawl warning). Decided/deferred items follow in separate PRs: the cross-platform decision procedure (§0), versioning gotchas (§4), markdown hygiene + the cspell en-US fix (§7), the Python HA-integration profile (§3), and the editor/scripts catalog snippets (§2).

🤖 Generated with Claude Code

Update the AGENTS.md Line Endings section to describe the `[*] end_of_line = crlf` default with LF exceptions - matching the merged editorconfig - instead of prescribing the old full-per-extension form, and add an EOL-audit note (byte-scan over `file`/`git ls-files --eol`, scope to `git ls-files`, multi-line edits emit CRLF, .code-workspace is JSONC). Add a Git rule to check the maintainer's uncommitted edits before committing.

Add copilot-instructions runbook gotchas: `gh pr edit` is broken (Projects-classic deprecation) so edit via updatePullRequest/PATCH; main/develop use rulesets not classic protection; the push -> head-SHA read race; and that Copilot findings can be factually wrong. Encodes retrospective #228 learnings (line endings, gh/Copilot mechanics, pre-commit checks).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 5, 2026 01:59

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 updates the repository governance docs to (1) align the documented line-ending policy and auditing guidance with the current .editorconfig/.gitattributes shape, and (2) add operational runbook notes about PR editing and merge-state interpretation in the GitHub CLI/Copilot workflow.

Changes:

  • Add a Git rule to check for maintainer-owned uncommitted working-tree edits before committing.
  • Reconcile and expand the Line Endings section, including an EOL-audit approach and JSONC note for .code-workspace.
  • Add PR-runbook "gotchas" about gh pr edit, rulesets vs classic protection, head-SHA read races, and verifying Copilot findings.

Reviewed changes

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

File Description
AGENTS.md Updates commit workflow guidance and reconciles/extends the documented line-ending policy and auditing procedure.
.github/copilot-instructions.md Adds a runbook subsection capturing PR-edit and merge-state troubleshooting gotchas.

Comment thread AGENTS.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Classify EOL audits as CRLF-only / LF-only / mixed (flag mixed, not lump into CRLF); use an explicit body-file name in the REST PATCH example; and correct the merge-state note (BLOCKED is a mergeStateStatus value, distinct from the mergeable field's MERGEABLE/CONFLICTING).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.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 2 out of 2 changed files in this pull request and generated no new comments.

Vanilla .py now follows the [*] = crlf default: Python's universal newlines accept CRLF, it compiles/imports/runs identically, and .py is commonly edited on Windows - a blanket LF pin just caused LF<->CRLF save-churn there. Pin LF only for a .py executed directly via its shebang, by path - spec/validate.py, the CI validation entry point - in both .editorconfig and .gitattributes, and drop the blanket *.py LF pin. Updates the AGENTS.md line-ending summary; revises #228 s1's blanket [*.py]=lf.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
@ptr727 ptr727 changed the title Reconcile line-ending docs and add PR-runbook gotchas Refine line-ending policy, default Python to CRLF, add runbook notes Jul 5, 2026
@ptr727
ptr727 requested a review from Copilot July 5, 2026 02:20

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

@ptr727
ptr727 merged commit b6cca1c into develop Jul 5, 2026
7 checks passed
@ptr727
ptr727 deleted the feature/line-ending-and-runbook-rules branch July 5, 2026 02:45
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