Thank you for your interest in contributing to langcodec! This document provides guidelines for contributing to the project.
- Rust 1.85 or later (Edition 2024 compatible)
- Git
1. Fork and clone the repository:
git clone https://github.com/oops-rs/langcodec.git
cd langcodec2. Install dependencies and run tests:
cargo test
cargo clippy --all-targets --all-features- Follow Rust's official style guide
- Use
cargo fmtto format code - Use
cargo clippyto check for common issues - Write comprehensive tests for new features
To add support for a new localization format:
- Create a new module in
langcodec/src/formats/ - Implement the
Parsertrait for your format - Add
From/TryFromconversions to/fromResource - Update
FormatTypeenum informats/mod.rs - Add tests in the appropriate test module
- Write unit tests for all new functionality
- Add integration tests for format conversions
- Include test data files in
tests/data/ - Ensure all tests pass before submitting PR
- Document all public APIs
- Update README.md for new features
- Add examples in doc comments
- Update the format support table in README.md
Follow the Conventional Commits specification to keep history readable and enable automated changelog tooling. See the official docs: https://www.conventionalcommits.org/en/v1.0.0/.
- Use the format:
<type>(<scope>): <subject> - type: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- scope (optional): one of lib, cli, formats, formats/android, formats/strings, formats/xcstrings, formats/csv, formats/tsv, transformers, validation, docs, tests
- subject: imperative mood, lowercase, ≤ 72 characters, no trailing period
- Separate body from subject with a blank line; explain motivation and impact
- Reference issues in the body or footer (e.g., Refs #123 or Fixes #123)
- Breaking changes: use
feat!:orfix!:in the subject, and include aBREAKING CHANGE:footer
Examples:
feat(cli): add --check_plurals to view command
fix(formats/android): escape apostrophes correctly in strings.xml
refactor(lib): simplify plural rules evaluation
chore: update dependencies
feat!: replace plural category API
feat(cli): add stats --json output
Provide machine-readable stats for CI consumers and human-readable summary by default.
BREAKING CHANGE: stats subcommand no longer prints totals by default; use --json.
1. Create a feature branch:
git checkout -b feature/your-feature-name2. Make your changes and commit:
git add .
git commit -m "feat: brief description of changes"3. Push and create a pull request:
git push origin feature/your-feature-nameWhen reporting issues:
- Use the issue template
- Include steps to reproduce
- Provide sample input files if relevant
- Include error messages and stack traces
- Specify your Rust version and platform
- All changes require review
- Address review comments promptly
- Ensure CI checks pass
- Update documentation as needed
- Update version numbers in
Cargo.tomlfiles - Update CHANGELOG.md
- Create and push a release tag like
v0.10.0 - GitHub Actions will build release binaries and attach them to the GitHub Release automatically
- Publish to crates.io
Thank you for contributing to langcodec!