Thank you for considering contributing to Probe! This document provides guidelines and instructions to make the contribution process smooth and effective.
- Code of Conduct
- Development Setup
- Development Workflow
- Pull Request Process
- Testing Guidelines
- Coding Standards
- Documentation
- Release Process
By participating in this project, you are expected to uphold our Code of Conduct. Please report unacceptable behavior to the project maintainers.
- Rust and Cargo (latest stable version)
- Git
- Make (for using the Makefile commands)
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/probe.git cd probe - Set up the git hooks to ensure code quality:
make install-hooks
- Add the original repository as a remote to keep your fork updated:
git remote add upstream https://github.com/probelabs/probe.git
To build the project in debug mode:
make buildTo run the application:
make runFor a release build:
make run-release-
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
or
git checkout -b fix/issue-you-are-fixing
-
Make your changes, following the Coding Standards
-
Run tests to ensure your changes don't break existing functionality:
make test -
Format your code:
make format
-
Run the linter:
make lint
-
Commit your changes using the Git Commit Message Guidelines
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request from your fork to the main repository
- Ensure your PR includes a clear description of the changes and the purpose
- Link any related issues using keywords like "Fixes #123" or "Resolves #456"
- Make sure all tests pass and there are no linting errors
- Add tests for new functionality
- Update documentation as needed
- Your PR will be reviewed by maintainers who may request changes
- Once approved, your PR will be merged
Probe uses several types of tests to ensure quality:
-
Run all tests:
make test -
Run specific test types:
make test-unit # Unit tests make test-integration # Integration tests make test-property # Property-based tests make test-cli # CLI tests
- Unit Tests: Place in the same file as the code being tested, using Rust's
#[cfg(test)]module - Integration Tests: Add to the
tests/directory - Property Tests: Use the proptest framework for property-based testing
- CLI Tests: Test the command-line interface functionality
- Follow the Rust API Guidelines
- Use
rustfmtfor consistent formatting (runmake format) - Use
clippyto catch common mistakes (runmake lint)
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests after the first line
- Consider using emoji prefixes for better readability:
- 🎨
:art:when improving code structure/format - 🐎
:racehorse:when improving performance - 📝
:memo:when writing docs - 🐛
:bug:when fixing a bug - ✅
:white_check_mark:when adding tests - 🔒
:lock:when dealing with security
- 🎨
- Update the README.md if you change functionality
- Document all public API items with rustdoc comments
- Include examples in documentation where appropriate
- Generate documentation with:
make doc
If you want to add support for a new programming language:
- Add the appropriate tree-sitter grammar dependency to
Cargo.toml - Implement the language parser in the
src/languagedirectory - Update the language detection logic
- Add tests for the new language support
- Update the documentation to include the new supported language
Releases are managed by the project maintainers. The process involves:
- Updating the version in
Cargo.toml - Building release packages for all supported platforms:
VERSION=vX.Y.Z make release
- Creating a new GitHub release with release notes
- Publishing the updated package
If you have any questions about contributing, feel free to open an issue or contact the project maintainers.
Thank you for contributing to Probe!