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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
docs/_build
.vscode/
.idea/
.worktrees/
File renamed without changes.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

All notable changes to this project will be documented in this file.

## [5.0.0] - 2025-12-10

### BREAKING CHANGES

- **Configuration file renamed from `hooks.toml` to `.peter-hook.toml`**
- Peter-hook now searches for `.peter-hook.toml` instead of `hooks.toml`
- If `hooks.toml` files are detected, peter-hook will error and refuse to run
- Migration: Rename all `hooks.toml` files to `.peter-hook.toml`
- Commands affected: All commands except `version` and `license`

**Migration guide:**

For single configuration:
```bash
mv hooks.toml .peter-hook.toml
```

For monorepos with multiple configurations:
```bash
# Find all deprecated files
find . -name "hooks.toml" -type f

# Rename each one
cd backend && mv hooks.toml .peter-hook.toml
cd ../frontend && mv hooks.toml .peter-hook.toml
```

**Why this change:**
- Follows dotfile conventions for tool configuration
- Reduces visual clutter in repository root
- Makes the file more discoverable as tool-specific config
- Aligns with modern CLI tool practices

## [Unreleased]

### Added
Expand Down
14 changes: 7 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ just bump-version patch # Bump version only (no release)
- **CLI Interface** (`src/cli/mod.rs`): Command-line interface

### Key Features
- **Hierarchical Configuration**: Nearest `hooks.toml` file wins
- **Hierarchical Configuration**: Nearest `.peter-hook.toml` file wins
- **Safe Parallel Execution**: Repository-modifying hooks run sequentially, read-only hooks run in parallel
- **Hook Groups**: Combine individual hooks with execution strategies
- **Cross-platform**: Rust implementation supporting macOS, Linux, Windows
Expand Down Expand Up @@ -333,7 +333,7 @@ Partial stderr: WARNING: Test database cleanup incomplete

### Multi-Config Group Execution Behavior

When multiple config groups are involved (different `hooks.toml` files for different changed files), peter-hook executes them sequentially with fail-fast semantics:
When multiple config groups are involved (different `.peter-hook.toml` files for different changed files), peter-hook executes them sequentially with fail-fast semantics:

**Execution Order:**
1. Groups are processed in the order they are resolved (typically by file path)
Expand All @@ -344,9 +344,9 @@ When multiple config groups are involved (different `hooks.toml` files for diffe
**Example Scenario:**
```
Changed files:
- backend/api.rs → Config Group A (backend/hooks.toml)
- frontend/app.tsx → Config Group B (frontend/hooks.toml)
- docs/README.md → Config Group C (docs/hooks.toml)
- backend/api.rs → Config Group A (backend/.peter-hook.toml)
- frontend/app.tsx → Config Group B (frontend/.peter-hook.toml)
- docs/README.md → Config Group C (docs/.peter-hook.toml)

Execution flow:
Group A (backend): Run hooks → SUCCESS ✓
Expand Down Expand Up @@ -375,9 +375,9 @@ Template variables use `{VARIABLE_NAME}` syntax and can be used in:
- `workdir` field (working directory paths)

**Available template variables:**
- `{HOOK_DIR}` - Directory containing the hooks.toml file
- `{HOOK_DIR}` - Directory containing the .peter-hook.toml file
- `{REPO_ROOT}` - Git repository root directory
- `{PROJECT_NAME}` - Name of the directory containing hooks.toml
- `{PROJECT_NAME}` - Name of the directory containing .peter-hook.toml
- `{HOME_DIR}` - User's home directory (from $HOME)
- `{PATH}` - Current PATH environment variable
- `{WORKING_DIR}` - Current working directory
Expand Down
66 changes: 58 additions & 8 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "peter-hook"
version = "4.0.3"
version = "5.0.0"
edition = "2024"
rust-version = "1.86.0"
authors = ["Peter Hook Contributors"]
Expand All @@ -27,6 +27,8 @@ serde = { version = "1.0", features = ["derive"] }
workhelix-cli-common = "0.4.1"
cargo-edit = "0.13.7"
wait-timeout = "0.2"
walkdir = "2"
ignore = "0.4"



Expand Down
Loading
Loading