Skip to content

Conversation

@tftio
Copy link
Owner

@tftio tftio commented Dec 10, 2025

Summary

This PR implements a breaking change that renames the configuration file from hooks.toml to .peter-hook.toml. This is version 5.0.0 and follows dotfile conventions for tool-specific configuration files.

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
  • All commands except version and license are affected

Migration Guide

For single configuration:

mv hooks.toml .peter-hook.toml

For monorepos with multiple configurations:

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

  • Dotfile conventions: Follows standard Unix/Linux practices for tool configuration
  • Reduced clutter: Hidden files keep repository root cleaner
  • Discoverability: Makes the file more identifiable as peter-hook-specific config
  • Modern practices: Aligns with contemporary CLI tool standards (e.g., .eslintrc.json, .prettierrc, .gitignore)

Changes Made

This PR includes:

  1. Deprecation detection (src/hooks/deprecation.rs)

    • Detects presence of old hooks.toml files
    • Provides helpful error messages with migration instructions
    • Reports all found deprecated files for easier migration
  2. Resolver updates (src/hooks/resolver.rs)

    • Updated to search for .peter-hook.toml instead of hooks.toml
    • Maintains hierarchical resolution behavior
    • Backward compatibility intentionally removed to enforce clean migration
  3. Comprehensive test updates

    • All 80+ tests updated to use .peter-hook.toml
    • New deprecation detection tests added
    • Integration tests verify error behavior with old config files
  4. Documentation updates

    • README.md updated with new filename
    • CLAUDE.md project guidelines updated
    • All example files renamed to .peter-hook-*.toml
    • Design documentation and historical context preserved
  5. Version bump to 5.0.0

    • Cargo.toml and VERSION file updated
    • CHANGELOG.md entry added with migration guide
    • Breaking change clearly documented

Testing

All tests pass with the new configuration filename:

  • Unit tests: Configuration parsing, resolver, executor
  • Integration tests: CLI behavior, error handling
  • Deprecation detection tests: Verify proper error messages

Commit History

15 commits implementing the rename:

  • Design documentation
  • Deprecation detection feature
  • Resolver updates with tests
  • Comprehensive test suite migration
  • Documentation updates across all files
  • Example file renames
  • Version bump to 5.0.0

Checklist

  • Breaking change documented in CHANGELOG.md
  • Migration guide provided
  • All tests updated and passing
  • Documentation comprehensively updated
  • Deprecation detection implemented
  • Version bumped to 5.0.0 (major version for breaking change)
  • Example files renamed

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.

2 participants