From c358a2b3bdeece1c995dcb5da6117d84839c0432 Mon Sep 17 00:00:00 2001 From: Steve Loeppky Date: Wed, 6 May 2026 12:07:18 -0700 Subject: [PATCH 1/2] chore: add pre-commit lint hook matching CI Add .githooks/pre-commit that runs ruff check and ruff format --check, matching the CI lint job exactly. Developers opt in with: git config core.hooksPath .githooks Co-Authored-By: Claude Opus 4.6 --- .githooks/pre-commit | 13 +++++++++++++ README.md | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 .githooks/pre-commit diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..d04bb8d --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Pre-commit hook: runs the same ruff checks as CI. +# Install with: git config core.hooksPath .githooks + +set -euo pipefail + +echo "Running ruff lint..." +uvx ruff check . + +echo "Running ruff format check..." +uvx ruff format --check . + +echo "All lint checks passed." diff --git a/README.md b/README.md index 3e17bf9..ae91fe7 100644 --- a/README.md +++ b/README.md @@ -144,9 +144,14 @@ This runs integration tests across `github-projects-client`, `filozzy-mcp`, and cd tpm-utils ``` -2. **Review the documentation** for the specific tool you need -3. **Set up any required dependencies** (Python 3, jq, etc.) -4. **Follow the workflow steps** outlined in each documentation file +2. **Enable the pre-commit lint hook** (runs the same `ruff` checks as CI): + ```bash + git config core.hooksPath .githooks + ``` + +3. **Review the documentation** for the specific tool you need +4. **Set up any required dependencies** (Python 3, jq, etc.) +5. **Follow the workflow steps** outlined in each documentation file ## Contributing From 5d9472d8cb9cee2b0a7946462fb8fa5982ff166a Mon Sep 17 00:00:00 2001 From: Steve Loeppky Date: Thu, 7 May 2026 11:18:53 -0700 Subject: [PATCH 2/2] fix: add uvx prerequisite check and install docs Add an explicit `command -v uvx` guard in the pre-commit hook with actionable install instructions, and note the uv/uvx prerequisite in the README Getting Started section. Co-Authored-By: Claude Opus 4.6 --- .githooks/pre-commit | 7 +++++++ README.md | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index d04bb8d..915ce57 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -4,6 +4,13 @@ set -euo pipefail +if ! command -v uvx &> /dev/null; then + echo "Error: 'uvx' is not installed or not on PATH." + echo "Install it via: curl -LsSf https://astral.sh/uv/install.sh | sh" + echo "See https://docs.astral.sh/uv/getting-started/installation/ for more options." + exit 1 +fi + echo "Running ruff lint..." uvx ruff check . diff --git a/README.md b/README.md index ae91fe7..1185d03 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,8 @@ This runs integration tests across `github-projects-client`, `filozzy-mcp`, and cd tpm-utils ``` -2. **Enable the pre-commit lint hook** (runs the same `ruff` checks as CI): +2. **Enable the pre-commit lint hook** (runs the same `ruff` checks as CI). + Requires [`uv`](https://docs.astral.sh/uv/getting-started/installation/) (provides `uvx`). ```bash git config core.hooksPath .githooks ```