Skip to content

Commit 2f4a254

Browse files
committed
add CLAUDE.md
1 parent 3b47658 commit 2f4a254

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a collection of custom [pre-commit](https://pre-commit.com) hooks implemented as shell scripts. The hooks are defined in `.pre-commit-hooks.yaml` and their implementations live in `scripts/`.
8+
9+
## Development Commands
10+
11+
```bash
12+
# Run all pre-commit hooks on all files
13+
pre-commit run --all-files
14+
15+
# Run a specific hook on all files
16+
pre-commit run --all-files <hook-id>
17+
18+
# Update hooks to latest versions (with frozen revisions)
19+
pre-commit autoupdate --freeze
20+
21+
# Install hooks locally
22+
pre-commit install
23+
```
24+
25+
## Architecture
26+
27+
- **`.pre-commit-hooks.yaml`**: Hook definitions that consumers reference. Uses `keep-sorted` directives to maintain alphabetical order.
28+
- **`scripts/`**: Shell script implementations for each hook. All scripts use `#!/usr/bin/env bash` and `set -euo pipefail`.
29+
- **`.pre-commit-config.yaml`**: This repo's own pre-commit configuration, used for self-validation and CI.
30+
31+
## Adding New Hooks
32+
33+
1. Create the script in `scripts/` with portable bash shebang (`#!/usr/bin/env bash`)
34+
2. Add the hook definition to `.pre-commit-hooks.yaml` within the `keep-sorted` block
35+
3. Update `README.md` with hook documentation
36+
37+
## CI
38+
39+
- **pre-commit.yml**: Runs pre-commit hooks on all files
40+
- **ls-lint.yml**: Validates file naming conventions
41+
42+
The `just-format` hook is skipped in CI (pre-commit.ci) because `just` is not available there.

0 commit comments

Comments
 (0)