Contributing
Guidelines for contributing to Gold Digger.
Getting Started
-
Fork the repository
-
Create a feature branch
-
Set up development environment:
just setup pre-commit install # Install pre-commit hooks
-
Make your changes
-
Add tests for new functionality
-
Ensure all quality checks pass:
just ci-check pre-commit run --all-files
-
Submit a pull request
Code Standards
Formatting
- Use
cargo fmt
for consistent formatting - 100-character line limit
- Follow Rust naming conventions
Quality Gates
All code must pass:
cargo fmt --check
cargo clippy -- -D warnings
cargo test
Pre-commit Hooks
Gold Digger uses comprehensive pre-commit hooks that automatically run on each commit:
- Rust: Code formatting, linting, and security auditing
- YAML/JSON: Formatting with Prettier
- Markdown: Formatting with mdformat (GitHub Flavored Markdown)
- Shell Scripts: Validation with ShellCheck
- GitHub Actions: Workflow validation with actionlint
- Commit Messages: Conventional commit format validation
- Documentation: Link checking and build validation
Install hooks: pre-commit install
Run manually: pre-commit run --all-files
Commit Messages
Use Conventional Commits:
feat: add new output format
fix: handle NULL values correctly
docs: update installation guide
Development Guidelines
Error Handling
- Use
anyhow::Result<T>
for fallible functions - Provide meaningful error messages
- Never panic in production code paths
Security
- Never log credentials or sensitive data
- Use secure defaults for TLS/SSL
- Validate all external input
Testing
- Write unit tests for new functions
- Add integration tests for CLI features
- Maintain test coverage above 80%
Pull Request Process
- Description: Clearly describe changes and motivation
- Quality Checks: Ensure all pre-commit hooks and CI checks pass
- Testing: Include test results and coverage information
- Documentation: Update docs for user-facing changes
- Review: Address feedback promptly and professionally
Before Submitting
Run the complete quality check suite:
# Run all CI-equivalent checks
just ci-check
# Verify pre-commit hooks pass
pre-commit run --all-files
# Test multiple feature combinations
just build-all
# Test release workflow (optional)
just release-dry
Code Review
Reviews focus on:
- Correctness and safety
- Performance implications
- Security considerations
- Code clarity and maintainability