Thank you for your interest in contributing to bwenv! This document provides guidelines for contributing to the project.
- Rust 1.85+ (rustup)
- pre-commit for git hooks
- Node.js (for commitlint)
# Clone the repository
git clone https://github.com/yourusername/bwenv.git
cd bwenv
# Install pre-commit hooks
pre-commit install
pre-commit install --hook-type commit-msg
# Build the project
cargo build
# Run tests
cargo testWe follow Conventional Commits specification. This enables automated changelog generation and semantic versioning.
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
feat: New feature (triggers MINOR version bump)fix: Bug fix (triggers PATCH version bump)docs: Documentation onlyperf: Performance improvementrefactor: Code restructuring (no behavior change)test: Adding or updating testsstyle: Code formatting (no logic change)build: Build system or dependenciesci: CI/CD configuration changeschore: Maintenance tasks (release, deps)revert: Revert previous commit
Use scopes to indicate which part of the codebase is affected:
cli: Command-line interfacesdk: Bitwarden SDK integrationconfig: Configuration management (.bwenv.toml)env: .env file parsingsync: Synchronization enginelogging: Logging systemdeps: Dependencies
Feature:
git commit -m "feat(cli): add --verbose flag for detailed output"Bug Fix:
git commit -m "fix(sdk): handle expired access tokens gracefully"Breaking Change:
git commit -m "feat(sync)!: change conflict resolution strategy
BREAKING CHANGE: Conflicts now default to local-wins instead of remote-wins.
Update your workflow if you relied on remote-wins behavior.
"Documentation:
git commit -m "docs: update installation instructions for macOS"Performance:
git commit -m "perf(env): optimize large .env file parsing"Chore:
git commit -m "chore(deps): update bitwarden SDK to 1.2.0"Your commits will be automatically validated by pre-commit hooks. If a commit message doesn't follow the convention, the commit will be rejected with a helpful error message.
Common mistakes to avoid:
- ❌
fix: Fix bug(subject should be lowercase, no period) - ❌
feat: Added new feature(use imperative mood: "add" not "added") - ❌
update stuff(missing type prefix) - ✅
fix: resolve authentication timeout issue
We use rustfmt for code formatting:
# Format code
cargo fmt
# Check formatting
cargo fmt -- --checkWe use clippy for linting:
# Run clippy
cargo clippy --all-targets -- -D warnings
# Fix auto-fixable issues
cargo clippy --fixOur clippy configuration is in clippy.toml. Key rules:
- Cognitive complexity threshold: 15
- Max function parameters: 7
- Type complexity threshold: 250
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
# Run benchmarks
cargo bench- Write tests for all new features
- Maintain or improve code coverage
- Use descriptive test names
- Test edge cases and error conditions
-
Fork the repository and create a feature branch from
main -
Make your changes following the code style guidelines
-
Write tests for your changes
-
Update documentation if needed (README, docs, comments)
-
Ensure all checks pass:
cargo test cargo fmt -- --check cargo clippy --all-targets -- -D warnings -
Commit with conventional commits format
-
Push to your fork and create a pull request
-
Respond to review feedback promptly
PR titles should also follow conventional commits:
feat(cli): add configuration file support
fix(sync): resolve race condition in token refresh
docs: improve installation guide
Releases are fully automated through GitHub Actions:
- When commits are pushed to
main, release-plz analyzes conventional commits - A Release PR is automatically created with:
- Version bump (based on commit types)
- Updated CHANGELOG.md
- When the Release PR is merged:
- Published to crates.io
- Git tag created
- GitHub release created with binaries for multiple platforms
- Homebrew formula updated (if configured)
You don't need to manually manage versions or changelogs - the automation handles it!
- Correctness: Does the code work as intended?
- Tests: Are there adequate tests?
- Documentation: Is the change well-documented?
- Style: Does it follow our style guidelines?
- Performance: Are there any performance concerns?
- Security: Are there any security implications?
We aim to review PRs within 48 hours. If you haven't received a review, feel free to ping the maintainers.
- Documentation: Check the README and Product Roadmap
- Issues: Search existing issues
- Discussions: Use GitHub Discussions
By contributing to bwenv, you agree that your contributions will be licensed under the project's MIT OR Apache-2.0 dual license.
Be respectful, inclusive, and professional. We follow the Rust Code of Conduct.
Thank you for contributing to bwenv! 🎉