Thank you for your interest in contributing to TaskFlow! We welcome contributions from everyone. This document provides guidelines and information for contributors.
- Getting Started
- Development Environment
- Code Style
- Building and Testing
- Submitting Changes
- Pull Request Process
- Reporting Issues
- License
- C++17 compatible compiler (GCC 7+, Clang 5+, MSVC 2017+)
- CMake 3.14 or higher
- Git for version control
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/VeloTask.git cd VeloTask - Add the upstream repository:
git remote add upstream https://github.com/merlotqi/VeloTask.git
TaskFlow uses the following dependencies:
- nlohmann/json: For JSON data handling (automatically fetched via CMake if not found)
- Threads: System threading library
-
Ensure you have CMake installed
-
Configure the project:
mkdir build && cd build cmake -S .. -B .
-
Build the project:
cmake --build .
- Visual Studio Code: Use the provided
.vscode/settings and extensions - CLion: Automatically detects CMake configuration
- VS Code with CMake Tools: Recommended for best CMake integration
TaskFlow follows specific coding standards to maintain code quality and consistency.
- Use clang-format with the provided
.clang-formatconfiguration - Based on Google style with 120 character line limit
- Run clang-format before committing:
find . -name "*.cpp" -o -name "*.hpp" | xargs clang-format -i
- Classes/Structs: PascalCase (e.g.,
TaskManager,TaskCtx) - Functions/Methods: camelCase (e.g.,
submit_task(),get_progress()) - Variables: snake_case (e.g.,
task_id,progress_info) - Constants: SCREAMING_SNAKE_CASE (e.g.,
MAX_THREADS) - Namespaces: lowercase (e.g.,
taskflow)
- C++17 Features: Use modern C++17 features where appropriate
- Error Handling: Use exceptions for exceptional cases, return values for expected errors
- Documentation: Document public APIs with clear comments
- Thread Safety: Ensure thread safety for shared resources
- Performance: Consider performance implications of changes
include/taskflow/ # Public headers
├── task_manager.hpp # Main task management
├── task_traits.hpp # Task trait definitions
├── task_ctx.hpp # Task execution context
├── state_storage.hpp # Internal state management
├── threadpool.hpp # Thread pool implementation
└── any_task.hpp # Type-erased task wrapper
examples/ # Example programs
├── task_types.hpp # Shared task type definitions
├── basic_task_submission.cpp
├── multiple_tasks.cpp
└── ...
Design documentation: docs/README.md and docs/ARCHITECTURE.md.
# Configure
cmake -S . -B build
# Build
cmake --build build
# Build with specific configuration
cmake --build build --config ReleaseTASKFLOW_BUILD_EXAMPLES=ON(default): Build example programsCMAKE_BUILD_TYPE=Debug|Release: Build configuration
After building, you can run individual examples:
# Run basic task submission example
./build/basic_task_submission
# Run multiple tasks example
./build/multiple_tasks
# Run task with progress example
./build/task_with_progressExamples are registered as CTest tests (taskflow_example_*). From the build directory:
ctest --output-on-failure
# or
cmake --build build --target taskflow_run_examplesSee examples/README.md for the full executable list.
GitHub Actions workflows (.github/workflows/):
- ci.yaml — Ubuntu, Clang, Debug,
clang-tidyoninclude/taskflow/, build, CTest. - cmake-multi-platform.yaml — Ubuntu (GCC and Clang) and macOS (Clang), Release, build, CTest;
clang-tidyon Ubuntu Clang only.
Pull requests and pushes to main / develop run these workflows; you can also trigger them manually via workflow_dispatch.
- Use clear, descriptive commit messages
- Start with a verb in imperative mood (e.g., "Add", "Fix", "Update")
- Reference issue numbers when applicable (e.g., "Fix #123: Handle edge case")
- Keep commits focused on single changes
Add support for custom progress types
Fix memory leak in task cancellation
Update documentation for persistent tasks
Refactor thread pool for better performance
- Use descriptive branch names
- Prefix with feature type:
feature/,bugfix/,docs/,refactor/
feature/add-custom-result-types
bugfix/handle-cancellation-race-condition
docs/update-contribution-guide
refactor/simplify-task-traits
- Create a Branch: Create a feature branch from
main - Make Changes: Implement your changes with tests
- Test Locally: Ensure all examples build and run correctly
- Format Code: Run clang-format on your changes
- Commit: Make focused commits with clear messages
- Push: Push your branch to your fork
- Create PR: Open a pull request against the main repository
When creating a pull request, include:
- Title: Clear, descriptive title
- Description: Detailed explanation of changes
- Related Issues: Reference any related issues
- Testing: Describe how you tested the changes
- Breaking Changes: Note any breaking changes
- Address review comments promptly
- Be open to feedback and suggestions
- Update your PR based on review feedback
- Keep the PR focused and avoid scope creep
When reporting bugs, please include:
- Description: Clear description of the issue
- Steps to Reproduce: Step-by-step instructions
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: OS, compiler version, CMake version
- Code Sample: Minimal code to reproduce the issue
For feature requests, include:
- Description: What feature you'd like to see
- Use Case: Why this feature would be useful
- Implementation Ideas: Any thoughts on implementation
- Alternatives: Alternative approaches considered
By contributing to TaskFlow, you agree that your contributions will be licensed under the same license as the project (see LICENSE file).
Contributors will be acknowledged in the project documentation. We appreciate all contributions, from bug reports to major features!
Thank you for contributing to TaskFlow! Your help makes this project better for everyone. 🎉