-
-
Notifications
You must be signed in to change notification settings - Fork 6
How to Contribute
Ryker Zhu edited this page Mar 7, 2026
·
1 revision
The litchi project welcomes contributions ranging from typo fixes to major parser features. This guide describes the day-to-day workflow maintainers expect from contributors.
- Discuss before you dig – comment on an existing issue or open a new one to describe the problem you plan to solve. Large design changes should include a short proposal so reviewers can validate the direction early.
-
Create a focused branch – branch names such as
feature/xlsb-text-functionorbugfix/ole-fib-csw-newmake review and later archaeology easier. - Work in small, reviewable chunks – keep PRs tightly scoped (single feature or bug). When a change requires multiple stages, land them sequentially and keep each stage releasable.
- Document as you go – update relevant wiki pages, markdown specs, and in-tree docs alongside code changes so knowledge stays fresh.
Before writing code, make sure your local environment can build the full workspace.
-
Rust toolchain – install the latest stable release via rustup. Enable
rustfmt,clippy, and other components usingrustup component add clippy rustfmt. -
System packages – ensure you have
pkg-config, OpenSSL headers, and a modern C toolchain (GCC/Clang) for FFI-enabled crates and SIMD glue code. -
Optional feature tooling – some sub-crates rely on
wasm32-unknown-unknownoraarch64targets. Add them withrustup target add <triple>if you intend to work on those paths. -
Git hooks & linting – run
cargo install cargo-nextest cargo-denyif you plan to work on CI parity locally.
- Run
cargo fmt --allto enforce consistent formatting before every commit. - Run
cargo clippy --all-targets --all-features(or scoped to the features you touch) and fix or annotate warnings. We do not accept new clippy warnings unless you can justify them. - Prefer idiomatic Rust patterns (iterators,
match, borrowing). Avoid needless clones and use thecommonhelper modules (SIMD, parsing utilities) whenever possible.
Automated tests are the primary safety net for regressions across file formats and feature flags.
- Run
cargo test --workspacefor a full check before opening a PR. For faster iterations, you can target individual crates withcargo test -p soapberry-zipor filter tests viacargo test name. - Feature-flagged modules should be exercised with
cargo test -p litchi --no-default-features --features ooxml,xlsb(substitute the flags relevant to your change). - When fixing bugs or adding features, include regression tests (parser cases, writer snapshots, or formula engine unit tests) to demonstrate the behavior.
Maintain a clean commit history and clear descriptions so reviewers can follow your reasoning.
- Use imperative, descriptive commit messages (e.g.,
Implement XLSB conditional formatting ranges). - Squash fixup commits locally when they only address review nits to keep history readable.
- Push your branch to your fork (or directly to the repo if you have access). Confirm CI pipelines pass or reproduce failures locally before requesting review.
- Fill out the PR template completely, including problem statement, test evidence, and any docs updates. Link the relevant issue for traceability.
- Highlight breaking changes or feature flags affected so maintainers can plan releases.
- Respond to every review comment—either implement the change, explain a rationale, or convert the thread to a follow-up issue if it is out of scope.
- Re-run formatting, linting, and tests after applying feedback to avoid regressions.
- Mark conversations as resolved only when reviewers agree the concern is addressed.
High-quality bug reports help maintainers reproduce and fix issues quickly.
- Summarize the problem – include file format, platform, and whether the issue occurs when parsing or writing documents.
- Share minimal inputs – attach the smallest sample file or paste the formula snippet that triggers the bug. If sensitive, describe the structure precisely so we can recreate it.
-
List exact steps – commands run (
cargo run --example xlsb_dump sample.xlsb), feature flags, and any environment variables. - Include expected vs. actual behavior – describe what you thought would happen and what actually occurred (panic, malformed bytes, incorrect AST, etc.).
-
Add logs or stack traces – run with
RUST_LOG=debugwhen possible and paste the relevant section inline or as an attachment.
The more precise your reproducer, the faster we can diagnose and deliver a fix.