Thank you for your interest in contributing to ztask-cpp!
Be respectful and constructive in all interactions.
Open an issue with:
- Clear description of the problem
- Minimal reproducible example
- Platform and compiler version
- Expected vs actual behavior
Open an issue with:
- Use case description
- Proposed API design
- Performance/memory impact analysis
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes following the coding standards below
- Add tests for new functionality
- Ensure all tests pass:
ctest --output-on-failure - Run sanitizers:
cmake -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined" - Update documentation if needed
- Commit with clear messages (no AI attribution)
- Push and open a pull request
- Follow Google C++ Style Guide
- C++14 standard, no C++17/20 features
- Header-only implementation
- No exceptions, no RTTI (must work with
-fno-exceptions -fno-rtti) - Use fixed-width types:
uint32_t,uint8_t, etc. - Prefer
constexprandnoexceptwhere applicable
- Classes:
PascalCase - Functions/methods:
PascalCase - Variables:
snake_case - Private members:
snake_case_(trailing underscore) - Constants:
kPascalCase - Template parameters:
PascalCase
- Doxygen-style comments for public API
- Explain non-obvious design decisions
- Include complexity analysis for algorithms
- Use Catch2 v3 framework
- Test file naming:
test_<module>.cpp - Cover edge cases: overflow, empty scheduler, full capacity
- Verify with ASan, UBSan, TSan (if applicable)
- Avoid heap allocation in hot paths
- Prefer stack allocation and compile-time sizing
- Document time/space complexity
- Benchmark performance-critical changes
# Clone
git clone https://github.com/DeguiLiu/ztask-cpp.git
cd ztask-cpp
# Build
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j
# Test
cd build && ctest --output-on-failure
# Sanitizer check
cmake -B build-asan -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined"
cmake --build build-asan -j
cd build-asan && ctest --output-on-failure
# No-exceptions check
cmake -B build-noexcept -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fno-exceptions -fno-rtti"
cmake --build build-noexcept -j
cd build-noexcept && ctest --output-on-failureBy contributing, you agree that your contributions will be licensed under the MIT License.