Skip to content
Merged
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "echo '\n[Reminder] Run: cargo fmt --all && make lint-fix'"
}
]
}
]
}
}
5 changes: 5 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# Pre-commit hook: runs cargo fmt --check
# Install with: make install-hooks

exec cargo fmt --check
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This file provides guidance for AI assistants (Claude Code, Codex, etc.) working with Lighthouse.

## CRITICAL - Always Follow

After completing ANY code changes:
1. **MUST** run `cargo fmt --all && make lint-fix` to format and fix linting issues
2. **MUST** run `cargo check` to verify compilation before considering task complete

Run `make install-hooks` if you have not already to install git hooks. Never skip git hooks. If cargo is not available install the toolchain.

## Quick Reference

```bash
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,9 @@ clean:
cargo clean
make -C $(EF_TESTS) clean
make -C $(STATE_TRANSITION_VECTORS) clean

# Installs git hooks from .githooks/ directory
install-hooks:
@ln -sf ../../.githooks/pre-commit .git/hooks/pre-commit
@chmod +x .githooks/pre-commit
@echo "Git hooks installed. Pre-commit hook runs 'cargo fmt --check'."