Skip to content

Add pre-commit hook and composite action - #7

Open
biggdawg320 wants to merge 1 commit into
greencalculus:mainfrom
biggdawg320:ci/precommit-action
Open

biggdawg320 wants to merge 1 commit into
greencalculus:mainfrom
biggdawg320:ci/precommit-action

Conversation

@biggdawg320

Copy link
Copy Markdown

Closes #3.

Adds a reusable pre-commit hook and composite GitHub Action for the existing checker. Both preserve the distinction between a verified finding (exit 1) and NOT CHECKED (exit 2): findings fail the integration, while ordinary unmatched or unreadable files do not. Runtime failures still propagate from the Action.

Also adds the exit-code contract to the built-in self-test and documents both integrations in the README.

Validation run locally:

  • PYTHONUTF8=1 python -m py_compile gwp_basis_check.py gwp_basis_check_hook.py
  • PYTHONUTF8=1 python gwp_basis_check.py --self-test
  • PYTHONUTF8=1 python render_tables.py --check
  • PYTHONUTF8=1 python gwp_basis_check.py README.md
  • wrapper/action-path checks for clean, NOT CHECKED, finding, and unmatched-path outcomes; YAML parse; git diff --check

The composite shell path was exercised locally with Git Bash plus the host Python shim. It has not run on hosted GitHub Actions yet.

AI-assisted implementation under Jim Hall's direction; scope, validation, and submission were reviewed by the project workflow.

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.

Add a pre-commit hook and a GitHub Action so projects can run this in CI

1 participant