Skip to content

Make Python pre-commit hooks cross-platform - #41

Open
ericpre wants to merge 4 commits into
mainfrom
remove_python_script_shebang
Open

ericpre wants to merge 4 commits into
mainfrom
remove_python_script_shebang

Conversation

@ericpre

@ericpre ericpre commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Description of the change

Make the shared Python tooling work consistently across Unix and Windows by launching hooks explicitly through Python, removing Unix-only shebang assumptions, and aligning executable-mode tests and Ruff checks.

Remove the check-agents-policy pre-commit hook. Instead, add an opt-in ai-policy-update job to the existing compliance.yml reusable workflow to create a pull request that update the policy automatically. A thin daily caller runs at 17 3 * * *, refreshes AGENTS.md from AI-POLICY.md, and creates or updates a ready-to-review pull request on a fixed ai-policy-update branch.

Documentation and workflow tests cover the reusable compliance and scheduling behavior.

AI-assisted contribution?

  • Human-only contribution or trivial change (no proposal needed)
  • AI-assisted, non-trivial — accepted proposal: N/A
  • If AI-assisted, Assisted-by: : in every commit and no AI Co-authored-by: trailer

Progress of the PR

  • Change implemented (can be split into several points),
  • tests added or updated (if appropriate),
  • documentation updated (if appropriate),
  • changelog entry added (if the repository uses upcoming_changes/),
  • ready for review.

Use explicit Python hook entries and remove Unix-only shebangs for Windows compatibility.

Assisted-by: GitHub Copilot:MAI Code 2 Flash
Use the system language and explicit Python entry for hooks so try-repo and consumer installs do not require a Python package. Remove executable modes that conflict with Ruff when scripts have no shebang.

Assisted-by: GitHub Copilot:MAI Code 2 Flash
Assert scripts are not executable on platforms that retain POSIX mode bits now that they intentionally omit shebangs.

Assisted-by: GitHub Copilot:MAI Code 2 Flash
@ericpre
ericpre marked this pull request as ready for review November 22, 2026 11:03
@ericpre
ericpre force-pushed the remove_python_script_shebang branch from 0a9830d to fad6d80 Compare November 22, 2026 18:52
Keep compliance.yml as the sole reusable implementation workflow, add an opt-in policy update job, and add a thin daily caller with a fixed draft branch.

Remove AI policy pre-commit hook

Assisted-by: GitHub Copilot:MAI Code 2 Flash
@ericpre
ericpre force-pushed the remove_python_script_shebang branch from fad6d80 to 82a1442 Compare November 22, 2026 19:05
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.

1 participant