Thank you for your interest in contributing to loon! This document provides guidelines and instructions for contributing.
- C++23 compatible compiler (GCC 13+, Clang 14+)
- CMake 3.20+
- Conan 2.x
- clang-format (for code formatting)
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/loon.git cd loon -
Set up Conan:
make conan-setup
-
Install dependencies and build:
make deps make build
-
Run tests to verify everything works:
make build # Tests run automatically
- Check existing issues to avoid duplicates
- Use a clear, descriptive title
- Include steps to reproduce for bugs
- For feature requests, explain the use case and expected behavior
-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following the coding standards below
-
Ensure all tests pass:
make build
-
Check code formatting:
make check-format
-
Commit your changes with a clear message:
git commit -m "Add feature: brief description" -
Push and create a pull request
- Keep PRs focused on a single change
- Update documentation if needed
- Add tests for new functionality
- Ensure CI passes before requesting review
- Link related issues in the PR description
- Follow the existing code style
- Use clang-format for formatting (run
make format) - Use meaningful variable and function names
- Keep functions small and focused
- Use modern C++ features (C++23)
- Prefer
std::optionalover null pointers - Use
constandconstexprwhere appropriate - Avoid raw pointers; use smart pointers or references
- Header-only: all code goes in
.hppfiles underinclude/loon/
This is a performance-focused library. Please consider:
- Avoid unnecessary allocations
- Minimize cache misses
- Use move semantics where appropriate
- Document time/space complexity for public APIs
- Write tests for all new functionality
- Place tests in
test/test_<component>.cpp - Use Google Test framework
- Aim for high coverage of edge cases
Example test structure:
#include <gtest/gtest.h>
#include <loon/your_header.hpp>
TEST(YourClass, DescriptiveTestName) {
// Arrange
// Act
// Assert
}loon/
├── include/loon/ # Header-only library sources
├── test/ # Unit tests
├── profiles/ # Conan profiles
├── test_package/ # Conan package test
└── .github/ # CI workflows
Feel free to open an issue for any questions about contributing.
By contributing to loon, you agree that your contributions will be licensed under the MIT License.