Thank you for considering contributing to Common System! This document provides guidelines and instructions for contributors.
- C++20 compatible compiler (GCC 13+, Clang 16+, MSVC 2022+)
- CMake 3.20 or higher
- Git
- vcpkg (recommended)
git clone https://github.com/kcenon/common_system.git
cd common_system
cmake --preset default
cmake --build buildcd build
ctest --output-on-failure- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes
- Run tests and ensure they pass
- Commit your changes (see commit message guidelines below)
- Push to your fork (
git push origin feature/your-feature) - Open a Pull Request
Follow the Conventional Commits format:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesrefactor: Code refactoringtest: Adding or modifying testsperf: Performance improvementchore: Maintenance tasks
- Use C++20 features when beneficial
- Follow existing code style (clang-format configuration provided)
- Prefer RAII for resource management
- Use
autofor obvious types - Avoid raw pointers; use smart pointers
- Prefer standard library over custom implementations
- Classes/Structs:
snake_case - Functions/Methods:
snake_case - Variables:
snake_case - Constants:
UPPER_SNAKE_CASE - Template Parameters:
PascalCase - Namespaces:
kcenon::common
Use Doxygen-style comments:
/**
* @brief Brief description
* @param param Parameter description
* @return Return value description
* @thread_safety Thread-safe / Not thread-safe
*/
auto function(int param) -> int;All code contributions must include tests:
- Unit tests: Test individual components
- Integration tests: Test component interactions
- Platform tests: Test platform-specific code paths
Use Google Test framework:
#include <gtest/gtest.h>
TEST(ComponentTest, BasicFunctionality) {
// Test implementation
}Aim for:
- New code: > 80% coverage
- Critical paths: 100% coverage
- Error handling: Test failure scenarios
Before submitting a PR, ensure:
- Code compiles without warnings
- All tests pass
- New tests added for new functionality
- Documentation updated
- Code follows project style
- Commit messages follow conventional format
- No merge conflicts with main branch
- Automated checks run (build, tests, linting)
- Maintainer reviews code
- Address review comments
- Approved PR is merged (squash merge preferred)
- Check existing issues
- Open a discussion for questions
By contributing, you agree that your contributions will be licensed under the BSD 3-Clause License.