Skip to content

chore: install pre-commit/pre-push git hooks - #96

Open
PenguinzTech wants to merge 1 commit into
release/v0.1.xfrom
chore/add-git-hooks
Open

chore: install pre-commit/pre-push git hooks#96
PenguinzTech wants to merge 1 commit into
release/v0.1.xfrom
chore/add-git-hooks

Conversation

@PenguinzTech

Copy link
Copy Markdown
Contributor

Summary

  • Installs the PenguinTech pre-commit framework (.pre-commit-config.yaml): hygiene, gitleaks, shellcheck, ruff, hadolint, actionlint on pre-commit; bandit + Dockerfile-rootless check on pre-push.
  • Adds install-hooks/verify-hooks Makefile targets; make setup now calls install-hooks instead of the broken hand-rolled setup-git-hooks (which referenced a nonexistent scripts/git-hooks/pre-commit).
  • Replaces pyproject.toml's [tool.isort]/[tool.black] with the canonical [tool.ruff] block; updates Makefile's setup-python to install ruff instead of black/isort/flake8.
  • Fixes a .gitignore bug where a bare lib/ pattern silently excluded scripts/lib/ from version control.

Known blocker (not fixed here — out of scope)

pre-commit run --all-files surfaces substantial pre-existing lint debt that predates this branch:

  • 876 ruff findings — mostly missing/malformed docstrings (D1xx/D4xx) and hardcoded-test-credential flags (S101/S105/S106) in test files.
  • hadolint version-pin warnings on app-skeleton/Dockerfile and services/flask-backend/Dockerfile.
  • actionlint/shellcheck findings in .github/workflows/build.yml and version-release.yml.

This was not fixed in this PR because it touches hundreds of unrelated files across ~25 in-flight feature branches off this release branch — a dedicated cleanup PR is the safer path. The hook mechanism itself is verified working (real git commit/git push triggered the actual hooks, not just pre-commit run).

Test plan

  • make install-hooks — hooks registered, config validates
  • make verify-hooks — pre-commit + pre-push both report installed
  • Real git commit triggered the pre-commit hook (not just pre-commit run --all-files)
  • Real git push triggered the pre-push hook
  • Follow-up: separate PR to clean up the 876 pre-existing ruff findings + hadolint/actionlint findings above

Adds the PenguinTech-standard pre-commit framework config (hygiene,
gitleaks, shellcheck, ruff, hadolint, actionlint, bandit, Dockerfile
rootless check) plus the install-hooks/verify-hooks Makefile targets.
Replaces the broken hand-rolled setup-git-hooks target (referenced a
nonexistent scripts/git-hooks/pre-commit) and the flake8/black/isort
config in pyproject.toml with the canonical ruff block.

Also fixes an unrelated .gitignore bug where a bare `lib/` pattern was
silently excluding scripts/lib/ from version control.

Note: `pre-commit run --all-files` surfaces substantial pre-existing
lint debt (876 ruff findings, mostly missing/malformed docstrings and
hardcoded-test-credential S105/S106/S101 flags in test files; plus
hadolint Dockerfile pin warnings and actionlint/shellcheck findings in
existing workflows) that predates this change. Fixing it here would
touch hundreds of unrelated files across ~25 in-flight feature
branches, so it is intentionally out of scope for this hooks-install
change and is reported separately as a follow-up.
@PenguinzTech PenguinzTech self-assigned this Aug 10, 2026
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