4.4 KiB
4.4 KiB
Contributing to Linux Hello
Thank you for your interest in contributing to Linux Hello! This document provides guidelines and information for contributors.
Code of Conduct
We follow the Contributor Covenant. Please read it before participating.
Getting Started
Prerequisites
- Rust 1.70+ (install via rustup)
- GCC (for PAM module)
- Development packages:
# Ubuntu/Debian sudo apt install build-essential libpam0g-dev v4l-utils pkg-config libssl-dev # Fedora sudo dnf install gcc make pam-devel v4l-utils pkgconfig openssl-devel # Arch Linux sudo pacman -S base-devel pam v4l-utils pkgconf openssl
Building
# Clone the repository
git clone https://github.com/YOUR_USERNAME/linux-hello.git
cd linux-hello
# Build all crates
cargo build
# Run tests
cargo test
# Build PAM module
cd pam-module && make
How to Contribute
Reporting Bugs
- Check existing issues to avoid duplicates
- Use the bug report template
- Include:
- Linux distribution and version
- Camera hardware (if relevant)
- Steps to reproduce
- Expected vs actual behavior
- Logs (if applicable)
Suggesting Features
- Open an issue with the feature request template
- Describe the use case
- Explain how it benefits users
Code Contributions
- Fork the repository
- Create a branch from
main:git checkout -b feature/your-feature-name - Make changes following our code style
- Write/update tests for your changes
- Run checks:
cargo fmt --check cargo clippy cargo test - Commit with a clear message:
git commit -m "feat: add new feature description" - Push and open a Pull Request
Commit Message Format
We follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation onlystyle:Code style (formatting, etc.)refactor:Code refactoringtest:Adding/updating testschore:Maintenance tasks
Examples:
feat: add blink detection to anti-spoofing
fix: correct camera enumeration on Fedora
docs: update installation instructions for Arch
Code Style
Rust
- Follow
rustfmtdefaults - Use
cargo clippyto catch common issues - Document public APIs with doc comments
- Keep functions under 60 lines when practical
/// Brief description of what the function does.
///
/// # Arguments
///
/// * `param` - Description of the parameter
///
/// # Returns
///
/// Description of return value
///
/// # Errors
///
/// When the function can fail and why
pub fn example_function(param: &str) -> Result<()> {
// Implementation
}
C (PAM Module)
- Follow Linux kernel style
- No
gotostatements - All loops must have fixed bounds
- Check all return values
- See CODING_STANDARDS.md for details
Testing
Running Tests
# All tests
cargo test
# Specific crate
cargo test -p linux-hello-daemon
# With output
cargo test -- --nocapture
# Integration tests (may require camera)
cargo test --test '*'
Writing Tests
- Place unit tests in the same file as the code
- Place integration tests in
/tests/ - Use descriptive test names:
test_function_condition_expected_result
Documentation
- Update README.md for user-facing changes
- Update docs/API.md for API changes
- Add inline documentation for complex code
- Include examples where helpful
Pull Request Process
- Ensure all CI checks pass
- Update documentation if needed
- Add tests for new functionality
- Request review from maintainers
- Address review feedback
- Squash commits if requested
Review Criteria
- Code quality and style
- Test coverage
- Documentation
- Security implications
- Performance impact
Security
If you discover a security vulnerability, please see SECURITY.md for responsible disclosure guidelines. Do not open public issues for security vulnerabilities.
License
By contributing, you agree that your contributions will be licensed under the GPL-3.0 License.
Questions?
- Open a Discussion for general questions
- Check existing issues and documentation first
- Be patient - maintainers are volunteers
Thank you for contributing! 🎉