Skip to content

chore(make): add pre-commit + install-hooks targets#8

Merged
Reddimus merged 1 commit into
mainfrom
chore/pre-commit-target
May 13, 2026
Merged

chore(make): add pre-commit + install-hooks targets#8
Reddimus merged 1 commit into
mainfrom
chore/pre-commit-target

Conversation

@Reddimus
Copy link
Copy Markdown
Owner

Summary

Adds two new Make targets to mirror the kalshi-cpp pattern (PR kalshi-trader#30 + PR kalshi-cpp#20):

  • make pre-commit runs format then lint in one shot.
  • make install-hooks drops a .git/hooks/pre-commit shim that fires make pre-commit automatically on git commit. Idempotent — re-running prints "already installed".

Why: every C++ SDK in this fleet has hit the same recurring CI break (a developer pushes, CI fails on clang-format / cpp_auto_audit, a follow-up PR is opened to fix). The pre-commit hook makes that class of break catchable locally before the push.

Pre-commit is opt-in (one-shot operator setup) and CI gates are unchanged — this is purely local DX.

Test plan

  • make pre-commit on a clean tree → format no-op + lint passes
  • make install-hooks writes .git/hooks/pre-commit and is executable
  • Second make install-hooks prints "pre-commit hook already installed" and exits 0
  • This commit itself fired the new hook (visible in commit output) and was accepted

Mirrors the kalshi-cpp Makefile pattern. Eliminates the recurring
"push -> CI clang-format/cpp_auto_audit fail -> follow-up fix PR"
loop by making the lint+format check trivially runnable before
every commit.

- `make pre-commit` runs `format` then `lint`
- `make install-hooks` drops .git/hooks/pre-commit that fires
  `make pre-commit` on every `git commit`. Idempotent.

Pre-commit hook is opt-in (one-shot operator setup) and CI gates
are unchanged — this is pure local DX.
@Reddimus Reddimus merged commit 8f6e74b into main May 13, 2026
4 checks passed
@Reddimus Reddimus deleted the chore/pre-commit-target branch May 13, 2026 16:11
Reddimus added a commit that referenced this pull request May 15, 2026
Tracks PRs #8 (pre-commit targets), #9/#10 (README install pin), #11
(LICENSE de-truncate), #12 (.editorconfig). Roll-up for the next
release.
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