This repository was archived by the owner on Jun 11, 2026. It is now read-only.
INF-1484/feat: extract inline shell to Python modules + add pytest#21
Merged
Merged
Conversation
Replaces the four inline shell/JS blocks in action.yaml with testable
Python modules under pre_commit_action/:
- detect_pm.py -- lockfile-based package manager detection
- install_node_deps.py -- pnpm/yarn/npm install dispatch
- run_hooks.py -- uvx pre-commit subprocess wrapper
- render_comment.py -- middle-truncation + markdown comment render
(replaces the github-script@v9 JS block entirely)
The action gains an "Install action scripts" step that pip-installs the
package from ${{ github.action_path }}, then each former shell/JS block
becomes a one-liner: `python -m pre_commit_action.<module>`.
Adds 19 pytest unit tests covering: PM detection priority, yarn
modern vs classic, npm install, pre-commit exit code propagation,
render success/failure comment content, missing output file, and
middle-truncation boundary conditions.
Adds .github/workflows/ci.yaml (pytest on PR + push to main) and
extends dependabot.yml with the pip ecosystem.
Refs INF-1484
https://claude.ai/code/session_014J66yccpjXZMWNfXH87B4J
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
This was referenced Jun 3, 2026
brtkwr
added a commit
that referenced
this pull request
Jun 4, 2026
The python-modules refactor (#21) dropped the set +e exit-code capture: under the composite shell's bash -e, a hook failure aborted the step before EXIT_CODE was written, continue-on-error masked the step failure, and the report step ran exit '' which succeeds. Every hook failure since has reported green. Restore the capture with -e disabled, drop the now-pointless continue-on-error, and make the report step fail loud if the exit code is ever missing.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
action.yamlinto a testable Python package (pre_commit_action/)github-script@v9JavaScript block with a Python equivalent, removing theactions/github-scriptdependency entirely.github/workflows/ci.yamlrunning pytest on every PR and push tomaindependabot.ymlwith the pip ecosystemAcceptance criteria
.github/workflows/ci.yamlScope check
Stayed within INF-1484 scope. No version bumps, no refactors outside the four step blocks.
Verification
Full CI run will complete in GitHub Actions after merge.
Fixes INF-1484
https://claude.ai/code/session_014J66yccpjXZMWNfXH87B4J