@gunw.dan/rusky
v0.1.1
Published
Simple Git hooks manager written in Rust - A dependency-free alternative to husky
Maintainers
Readme
🐺 rusky
Simple Git hooks manager written in Rust - A dependency-free alternative to husky
✨ Features
- 🚀 Drop-in Replacement: Works exactly like husky - no learning curve
- 🔧 Simple Setup: One command to get started
- 📦 Zero Runtime Dependencies: No Node.js dependencies to manage
- 🎯 Git Integration: Seamless integration with Git hooks
- 🛡️ Type Safe: Built with Rust's compile-time safety guarantees
- 🌍 Cross Platform: Works on macOS, Linux, and Windows
📦 Installation
npm install --save-dev @gunw.dan/ruskyThat's it! No additional dependencies, no complex setup. rusky works exactly like husky but with zero runtime dependencies.
🚀 Quick Start
- Initialize rusky in your project:
npx @gunw.dan/rusky init- Add a git hook:
npx @gunw.dan/rusky add pre-commit "npm test"- Add more hooks as needed:
npx @gunw.dan/rusky add pre-push "npm run lint"
npx @gunw.dan/rusky add commit-msg "npx commitlint --edit $1"📚 Commands
rusky init
Initialize rusky in your project. This creates a .rusky directory and sets up the git hooks directory.
npx @gunw.dan/rusky initrusky add <hook> <command>
Add a git hook with the specified command.
npx @gunw.dan/rusky add pre-commit "npm test"
npx @gunw.dan/rusky add pre-push "npm run build"rusky remove <hook>
Remove a git hook.
npx @gunw.dan/rusky remove pre-commitrusky list
List all configured hooks.
npx @gunw.dan/rusky listrusky install
Install all configured git hooks.
npx @gunw.dan/rusky installrusky uninstall
Uninstall all git hooks managed by rusky.
npx @gunw.dan/rusky uninstall🎯 Supported Git Hooks
rusky supports all standard Git hooks:
pre-commit- Before commitprepare-commit-msg- Before commit message editorcommit-msg- After commit messagepost-commit- After commitpre-rebase- Before rebasepost-checkout- After checkoutpost-merge- After mergepre-push- Before pushpre-receive- Before receive (server-side)update- Before update reference (server-side)post-receive- After receive (server-side)post-update- After update reference (server-side)push-to-checkout- Before push to checkoutpre-auto-gc- Before auto gcpost-rewrite- After rewrite
🔧 Configuration
rusky stores its configuration in .rusky/config.json:
{
"hooks": {
"pre-commit": "npm test",
"pre-push": "npm run lint"
},
"version": "0.1.0"
}🆚 Why choose rusky?
Simple, reliable, and dependency-free Git hooks management
| Feature | rusky | husky | |---------|-------|-------| | Setup | 🚀 One command | 📚 Multiple steps | | Dependencies | 🚫 Zero runtime | 📦 Multiple Node.js deps | | Learning Curve | 📖 Same as husky | 📖 Same as rusky | | Maintenance | 🔧 Less to manage | 🔧 More dependencies | | Language | 🦀 Rust | 📜 Node.js | | Type Safety | 🛡️ Compile-time | ⚠️ Runtime |
Perfect for: Teams who want the same husky experience with fewer dependencies and simpler maintenance.
🛠️ Development
Prerequisites
- Rust 1.70+
- Node.js 14+
Building from source
# Clone the repository
git clone https://github.com/geonhwiii/rusky.git
cd rusky
# Build the project
cargo build --release
# Run tests
cargo test
# Install locally
npm installRunning tests
# Run all tests
cargo test
# Run specific test modules
cargo test config::tests # Config module tests
cargo test cli::tests # CLI module tests
cargo test hooks::tests # Hooks module tests
cargo test git::tests # Git module tests
# Run integration tests
cargo test --test integration_tests
# Run unit tests only (no integration tests)
cargo test --lib
# Run tests with output
cargo test -- --nocaptureTest Coverage
rusky includes comprehensive test coverage:
Unit Tests: Test individual functions and modules
config.rs: Configuration management testscli.rs: CLI command logic testshooks.rs: Hook file management testsgit.rs: Git integration tests
Integration Tests: End-to-end testing of CLI commands
- Full workflow testing (init → add → commit → remove)
- Error handling and edge cases
- Cross-platform compatibility
Test Features:
- Isolated test environments using temporary directories
- Git repository simulation for testing
- Comprehensive error scenario coverage
- Performance and functionality validation
📄 License
MIT © geonhwiii
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
🔗 Related Projects
- husky - The original Git hooks manager
- pre-commit - A framework for managing pre-commit hooks
- commitlint - Lint commit messages
Made with ❤️ and 🦀 by geonhwiii
