Thank you for considering contributing to fastcert! This document provides guidelines and instructions for contributing.
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior.
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
- A clear and descriptive title
- Exact steps to reproduce the problem
- Expected behavior vs actual behavior
- Your environment (OS, Rust version, fastcert version)
- Any relevant error messages or logs
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- A clear and descriptive title
- Detailed description of the proposed functionality
- Explain why this enhancement would be useful
- List any similar features in other tools
- Fork the repository
- Create a new branch for your feature or fix
- Make your changes
- Add tests for your changes
- Ensure all tests pass
- Update documentation if needed
- Submit a pull request
- Rust 1.70 or later
- Cargo
- Git
git clone https://github.com/yourusername/fastcert.git
cd fastcert
cargo build# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_nameThis project uses standard Rust formatting:
# Format code
cargo fmt
# Check formatting
cargo fmt -- --check
# Run clippy for lints
cargo clippy
# Fix clippy suggestions
cargo clippy --fix- Use clear and descriptive commit messages
- Start with a verb in present tense (e.g., "add", "fix", "update")
- Keep the first line under 72 characters
- Reference issues and pull requests when relevant
Good examples:
- "add support for custom validity periods"
- "fix certificate generation for wildcard domains"
- "update README with installation instructions"
Avoid:
- "fixed stuff"
- "updates"
- "WIP"
fastcert/
├── src/
│ ├── main.rs # CLI entry point
│ ├── lib.rs # Library exports
│ ├── ca.rs # CA management
│ ├── cert.rs # Certificate generation
│ ├── error.rs # Error types
│ ├── fileutil.rs # File utilities
│ └── truststore/ # Trust store integrations
│ ├── mod.rs
│ ├── macos.rs
│ ├── linux.rs
│ ├── windows.rs
│ ├── nss.rs
│ └── java.rs
├── tests/ # Integration tests
├── Cargo.toml # Dependencies
└── README.md # Documentation
Add unit tests in the same file as the code:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_something() {
// Your test here
}
}Add integration tests in the tests/ directory:
use fastcert;
#[test]
fn test_full_workflow() {
// Your integration test here
}Some features are platform-specific. Use conditional compilation:
#[cfg(target_os = "macos")]
#[test]
fn test_macos_feature() {
// macOS-specific test
}- Add doc comments to all public APIs
- Update README.md for user-facing changes
- Include examples in doc comments
- Keep documentation clear and concise
Example:
/// Generates a new certificate for the specified domains.
///
/// # Arguments
///
/// * `domains` - A list of domain names or IP addresses
/// * `ecdsa` - Whether to use ECDSA instead of RSA
///
/// # Examples
///
/// ```
/// use fastcert::cert::generate_certificate;
///
/// generate_certificate(&["example.com"], None, None, None, false, false, false)?;
/// ```
pub fn generate_certificate(domains: &[String], ...) -> Result<()> {
// Implementation
}- Update version in Cargo.toml
- Update CHANGELOG.md
- Create a git tag
- Push tag to trigger release
When adding features, consider:
- macOS compatibility
- Linux compatibility (multiple distros)
- Windows compatibility
- Graceful degradation when features aren't available
- Open an issue for questions
- Check existing issues and pull requests
- Review the README and documentation
By contributing, you agree that your contributions will be licensed under the MIT License.