Thank you for your interest in contributing to the userd project! This document will help you understand how to contribute.
- How to Contribute
- Development Environment Setup
- Code Standards
- Commit Conventions
- Pull Request Process
If you find a bug, please submit a report via GitHub Issues with the following information:
- Detailed description of the problem
- Steps to reproduce
- Expected behavior and actual behavior
- Operating system and compiler version
- Relevant configuration files or logs
Feature suggestions should also be submitted via GitHub Issues, including:
- Detailed description of the feature
- Use cases
- Expected implementation approach
- Fork this repository
- Create your feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/your-feature) - Create a Pull Request
- C++17 or later
- POSIX compatible system (Linux, macOS)
- g++ or clang++ compiler
# Clone the repository
git clone https://github.com/Carry-Rao/userd.git
cd userd
# Build debug version
make debug# Run all tests (if any)
make test- Follow Google C++ Style Guide
- Use 4 spaces for indentation, no tabs
- Line width limit of 100 characters
- Use
snake_casefor variables and functions - Use
PascalCasefor classes and structs - Use
UPPER_CASEfor constants and macros
- Header files use
.hppextension - Source files use
.cppextension - Each class or struct should be defined in a separate header file
- Use
#pragma onceto prevent duplicate header file inclusion
- Class names:
PascalCase - Function names:
snake_case - Variable names:
snake_case - Constant names:
UPPER_CASE - Member variables: Use underscore prefix
_variable
- All public interfaces must have documentation comments
- Complex algorithms or logic need comments
- Use
//for line comments - Use
/* */for block comments
Commit messages should follow this format:
Type: Brief description
Detailed description (optional)
Feature: New featureFix: Bug fixDocs: Documentation updateStyle: Code format adjustment (does not affect code execution)Refactor: Code refactoringTest: Add or modify testsChore: Build process or auxiliary tool changes
Feature: Add service status query functionality
Support querying service running status through userctl status command
Fix: Fix service restart failure issue
Fixed the issue where services could not restart correctly after abnormal exit
- Fork Repository: Fork this repository on GitHub
- Create Branch: Create your feature branch from the
mainbranch - Write Code: Write code according to code standards
- Add Tests: Add tests for new features or bug fixes
- Update Documentation: Update related documentation and comments
- Commit Code: Commit code according to commit conventions
- Create PR: Create a Pull Request on GitHub
- Code Review: Wait for project maintainer to conduct code review
- Merge Code: After approval, code will be merged to main branch
## Description
Briefly describe your changes
## Change Type
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Other
## Testing
Describe how you tested these changes
## Related Issues
Close #issue_numberIf you have any questions or need help, please contact us through:
- Creating a GitHub Issue
- Sending an email to the project maintainer
Thank you for your contribution!