Skip to content

Conversation

@douglaz
Copy link
Owner

@douglaz douglaz commented Aug 14, 2025

Summary

Add Git hooks to maintain code quality and consistency across all contributors.

Changes

  • Add pre-commit hook that checks code formatting
  • Add pre-push hook that runs both formatting and clippy checks
  • Configure automatic hook setup via nix develop shellHook
  • Add Development section to README documenting the hooks

Technical Details

  • Hooks detect nix environment and use nix develop -c when available
  • Falls back to regular cargo commands if nix is not available
  • Hooks are automatically configured when entering nix shell (non-intrusive, only sets if not already configured)
  • Uses --workspace flag for clippy to check entire workspace

Testing

  • Pre-commit hook tested: blocks commits with unformatted code
  • Pre-push hook tested: blocks pushes with formatting or clippy issues
  • Automatic setup tested: works correctly in nix develop
  • Manual configuration/removal tested: git config commands work as documented

This follows the same pattern successfully implemented in cyberkrill, nostrweet, replicante, and hidraw-rs projects.

- Add pre-commit hook for formatting checks
- Add pre-push hook for formatting and clippy checks
- Configure automatic setup via nix develop shellHook
- Update README with development section documenting hooks
- Ensure consistent code quality across contributors
@douglaz douglaz enabled auto-merge August 14, 2025 03:30
@douglaz douglaz merged commit 675ce03 into master Aug 14, 2025
1 check passed
@douglaz douglaz deleted the feat/add-git-hooks branch August 14, 2025 03:46
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