Thank you for your interest in contributing to the Global Type System (GTS) Rust implementation! This document provides guidelines and information for contributors.
- Git for version control
- Rust 1.70+ for building and running the implementation
# Clone the repository
git clone https://github.com/globaltypesystem/gts-rust
cd gts-rust
# Build the project
cargo build
# Run tests
cargo test
# Running Code Coverage
# To measure test coverage, ensure you have [`cargo-llvm-cov`](https://github.com/taiki-e/cargo-llvm-cov) installed:
```bash
cargo install cargo-llvm-cov
cargo llvm-cov --libgts-rust/
├── README.md # Main project documentation
├── CONTRIBUTING.md # This file
├── LICENSE # License information
├── Cargo.toml # Workspace configuration
├── gts/ # Core GTS library
│ ├── src/ # Library source code
│ └── tests/ # Integration tests
├── gts-cli/ # Command-line interface
│ └── src/ # CLI source code
└── examples/ # Usage examples
git checkout -b feature/your-feature-nameUse descriptive branch names:
feature/add-query-filtersfix/uuid-generation-edge-casedocs/update-readme-examplestest/wildcard-matching
Follow the code style and patterns described below.
# Run all tests
cargo test
# Format code
cargo fmt
# Run linter
cargo clippyFollow a structured commit message format:
<type>(<module>): <description>
<type>: change category (see table below)<module>(optional): the area touched (e.g., core, cli, parser)<description>: concise, imperative summary
Accepted commit types:
| Type | Meaning |
|---|---|
| feat | New feature |
| fix | Bug fixes |
| docs | Documentation updates |
| test | Adding or modifying tests |
| style | Formatting changes (rustfmt, whitespace, etc.) |
| refactor | Code changes that neither fix bugs nor add features |
| perf | Performance improvements |
| chore | Misc tasks (tooling, dependencies) |
| breaking | Backward incompatible changes |
Best practices:
- Keep the title concise (ideally <50 chars)
- Use imperative mood (e.g., "Fix bug", not "Fixed bug")
- Make commits atomic (one logical change per commit)
- Add details in the body when necessary (what/why, not how)
- For breaking changes, either use
breaking!:or include aBREAKING CHANGE:footer
Examples:
feat(parser): Add support for wildcard queries
fix(core): Resolve UUID generation edge case
docs: Update README with CLI examples
test(query): Add tests for filter syntax
- Follow Rust standard formatting:
cargo fmt - Use 4 spaces for indentation
- Keep lines under 100 characters when reasonable
- Run clippy and address all warnings:
cargo clippy - Fix all clippy warnings before submitting a PR
- Add unit tests in the same file as the code (using
#[cfg(test)]modules) - Add integration tests in the
tests/directory - Ensure all tests pass before submitting a PR
- Write tests for new functionality
- Aim for high code coverage
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
cargo test - Format code:
cargo fmt - Run clippy:
cargo clippy - Commit with descriptive messages (see commit message guidelines above)
- Push to your fork
- Open a Pull Request with a clear description
## Description
Brief description of the changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
Describe the tests you ran and how to reproduce them
## Checklist
- [ ] Tests pass (`cargo test`)
- [ ] Code is formatted (`cargo fmt`)
- [ ] No clippy warnings (`cargo clippy`)
- [ ] Documentation is updatedThis implementation maintains 100% feature parity with the Python reference implementation. When adding features:
- Check the Python implementation first
- Ensure behavior matches exactly
- Update tests to verify compatibility
- Document any intentional differences (e.g., Rust-specific optimizations)
Open an issue or discussion on GitHub.
By contributing, you agree that your contributions will be licensed under the Apache-2.0 License.