Contributing
Contributions are welcome!
Development Setup
git clone https://github.com/liujinguo/problemreductions
cd problemreductions
cargo build
cargo test
Running Tests
cargo test # Run all tests
cargo test --test integration # Integration tests only
cargo test --test reduction # Reduction tests only
Code Coverage
cargo tarpaulin --skip-clean --ignore-tests
Documentation
cargo doc --open # Rustdoc
mdbook serve # mdBook (requires mdbook installed)
Adding a New Problem
- Create file in
src/models/<category>/ - Implement
Problemtrait - Optionally implement
ConstraintSatisfactionProblem - Add tests
- Export in
mod.rsandprelude
Adding a New Reduction
- Create file in
src/rules/ - Implement
ReductionResultfor the result type - Implement
ReduceTo<Target> for Source - Add edge in
ReductionGraph - Add tests
- Export in
mod.rs
Code Style
- Run
cargo fmtbefore committing - Run
cargo clippyand fix warnings - Add doc comments for public items
- Include examples in documentation