We've set up a comprehensive pre-commit pipeline for Bury with automated quality checks.
Automatically runs before every commit:
- ✅ Format code -
cargo fmt - ✅ Lint code -
cargo clippy(strict mode, warnings = errors) - ✅ Check compilation -
cargo check - ✅ Run tests -
cargo test - ✅ Complexity analysis -
pmat(non-blocking) - ✅ Standard checks - trailing whitespace, YAML/TOML validation, etc.
Easy-to-use development commands:
make help # Show all targets
make fmt # Format code
make lint # Lint with clippy
make check # Check compilation
make test # Run tests
make complexity # Analyze complexity
make all # Run all checks
make ci # Run full CI pipeline
make pre-commit-run # Run pre-commit manuallyAutomated CI on every push/PR:
- ✅ Format check
- ✅ Clippy lint (strict)
- ✅ Compilation check
- ✅ Unit tests (Ubuntu, macOS, Windows)
- ✅ Multiple Rust versions (stable, nightly)
- ✅ Code coverage (with tarpaulin)
- ✅ Complexity analysis (pmat)
- ✅ Release builds
One-command developer onboarding:
./scripts/setup.shInstalls:
- Rust components (rustfmt, clippy)
- pmat (complexity analyzer)
- pre-commit hooks
Complete documentation for:
- Development workflow
- Pre-commit hooks usage
- CI/CD pipeline
- Troubleshooting
- Code style guidelines
# Setup environment
git clone https://github.com/paolorechia/bury
cd bury
./scripts/setup.sh
# Develop
make fmt # Format before committing
make all # Run all checks
git commit -m "..." # Pre-commit runs automatically# Quick format
make fmt
# Full check before commit
make all
# Run specific check
make lint
make test# Run on all files
pre-commit run --all-files
# Run specific hook
pre-commit run cargo-fmt --all-files
# Skip hooks (not recommended)
git commit --no-verify- Formatting - Code must be properly formatted
- Linting - No clippy warnings allowed
- Compilation - Code must compile
- Tests - All tests must pass
- Complexity - Warning if functions are too complex
All of the above PLUS:
- Multi-platform testing (Linux, macOS, Windows)
- Multiple Rust versions (stable, nightly)
- Code coverage reporting
- Release build verification
- ✅ Removed unused
parserfields in PythonParser and TypeScriptParser - ✅ Fixed
useless_format!warnings in markdown reporter - ✅ Fixed
len() >= 1to!is_empty()in tests - ✅ Fixed scanner test to properly create temporary files
- ✅ 0 clippy warnings (strict mode)
- ✅ All tests passing (8/8)
- ✅ Code formatted (rustfmt)
- ✅ Compilation clean
GitHub Actions will now run on every:
- Push to
main - Pull request to
main
View runs at: https://github.com/paolorechia/bury/actions
- ✅ Consistent code quality
- ✅ Catch issues before merge
- ✅ Automated testing across platforms
- ✅ Easy contributor onboarding
- ✅ Clear guidelines (DEVELOPMENT.md)
- ✅ Automated formatting (no debates)
- ✅ Immediate feedback (pre-commit)
- ✅ Confidence in changes (CI)
Potential additions:
- Benchmarking (cargo bench)
- Security audits (cargo audit)
- Dependency updates (dependabot)
- Release automation
- Performance regression detection
Bury now has production-grade quality automation:
- Pre-commit hooks prevent bad commits
- CI ensures cross-platform compatibility
- Makefile simplifies common tasks
- Documentation guides contributors
The pipeline works perfectly and all checks pass! ✨
Next time a commit is made, pre-commit will automatically run all checks!