Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 && cargo check'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need cargo check if we already run clippy

}
]
}
]
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this format until my local claude CLI accepted the format.

}
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## 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

## Development Commands

**Important**: Always branch from `unstable` and target `unstable` when creating pull requests.
Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ bytes = "1.11.1"
# Turn off c-kzg's default features which include `blst/portable`. We can turn on blst's portable
# feature ourselves when desired.
c-kzg = { version = "2.1", default-features = false }
cargo-husky = { version = "1", default-features = false, features = ["precommit-hook", "run-cargo-fmt"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I'm not sure if it's worth introducing a dependency for this. It's also unmaintained, but I see benefits over native git hooks - without devs having to manually set it up.

Now i feel like it might be better to just include it in the AI file you originally suggested.

With cargo-husky requiring at least a cargo task to trigger, i think there might be a chance that this never gets run, e.g. AI-generated PRs etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a make command to add it your local dir, and then we expect team members to add it

cargo_metadata = "0.19"
clap = { version = "4.5.4", features = ["derive", "cargo", "wrap_help"] }
clap_utils = { path = "common/clap_utils" }
Expand Down
2 changes: 2 additions & 0 deletions lighthouse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rust-version = "1.88.0"
# to assert properties of the compilation target.
[package.metadata.cargo-udeps.ignore]
normal = ["target_check"]
development = ["cargo-husky"]

[features]
default = ["slasher-lmdb", "beacon-node-leveldb"]
Expand Down Expand Up @@ -84,6 +85,7 @@ malloc_utils = { workspace = true, features = [] }
beacon_node = { workspace = true, features = ["testing"] }
beacon_node_fallback = { workspace = true }
beacon_processor = { workspace = true }
cargo-husky = { workspace = true }
eth2 = { workspace = true }
initialized_validators = { workspace = true }
lighthouse_network = { workspace = true }
Expand Down