|
| 1 | +<!--- |
| 2 | + Copyright 2026-present Alibaba Inc. |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +--> |
| 16 | + |
| 17 | +# Contributing to Paimon C++ |
| 18 | + |
| 19 | +Thank you for your interest in contributing to paimon-cpp! This document explains how to get started. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Reporting Issues |
| 24 | + |
| 25 | +If you find a bug or want to request a feature, please open an [issue](https://github.com/alibaba/paimon-cpp/issues/new). Include as much detail as possible — steps to reproduce, expected vs. actual behavior, environment info, etc. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## Submitting Pull Requests |
| 30 | + |
| 31 | +1. **Fork** the repository and create a feature branch from `main`. |
| 32 | +2. Make your changes following the [Code Style Guide](docs/code-style.md). |
| 33 | +3. Add or update tests for the functionality you changed. |
| 34 | +4. Ensure all checks pass. |
| 35 | +5. Open a pull request against `main`. Fill in the [PR template](.github/PULL_REQUEST_TEMPLATE.md). |
| 36 | + |
| 37 | +### PR Checklist |
| 38 | + |
| 39 | +Before submitting, please verify: |
| 40 | + |
| 41 | +- [ ] Code compiles without warnings under `-Wall` (enabled by default in the build system). |
| 42 | +- [ ] `pre-commit run --all-files` passes. |
| 43 | +- [ ] New / modified public APIs are marked with `PAIMON_EXPORT`. |
| 44 | +- [ ] Every new file has the Apache 2.0 license header. |
| 45 | +- [ ] Error handling uses `Status` / `Result<T>` — no exceptions. |
| 46 | +- [ ] New utility code checks for existing helpers before reinventing (see the [utility reference](docs/code-style.md#reuse-existing-utilities)). |
| 47 | +- [ ] Tests are added or updated for the changed functionality. |
| 48 | +- [ ] PR description follows the [template](.github/PULL_REQUEST_TEMPLATE.md). |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## Development Setup |
| 53 | + |
| 54 | +### Prerequisites |
| 55 | + |
| 56 | +- **C++17** compatible compiler (GCC recommended) |
| 57 | +- **CMake** ≥ 3.16 |
| 58 | +- **Python 3** (for linting scripts and pre-commit) |
| 59 | +- **git-lfs** (the repository uses Git LFS for large files) |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Code Style |
| 64 | + |
| 65 | +Please read the full [Code Style Guide](docs/code-style.md) before writing code. Key highlights: |
| 66 | + |
| 67 | +- **Formatting**: Google C++ Style base, 100-column limit, 4-space indent. Let clang-format handle it. |
| 68 | +- **Error handling**: Use `Status` / `Result<T>` and project macros (`PAIMON_RETURN_NOT_OK`, `PAIMON_ASSIGN_OR_RAISE`). No exceptions. |
| 69 | +- **Naming**: PascalCase for classes and methods, snake_case for variables, trailing `_` for members. |
| 70 | +- **Headers**: `#pragma once`, includes ordered by category, Apache 2.0 license header on every file. |
| 71 | +- **Factory pattern**: Use `static Create()` + private constructor when construction can fail. |
| 72 | +- **Testing**: Google Test, `ASSERT_*` preferred over `EXPECT_*`, test files named `*_test.cpp` next to source. |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Dev Containers |
| 77 | + |
| 78 | +We provide Dev Container configuration file templates for VS Code: |
| 79 | + |
| 80 | +```bash |
| 81 | +cd .devcontainer |
| 82 | +cp Dockerfile.template Dockerfile |
| 83 | +cp devcontainer.json.template devcontainer.json |
| 84 | +``` |
| 85 | + |
| 86 | +Then select **Dev Containers: Reopen in Container** from VS Code's Command Palette. |
| 87 | + |
| 88 | +If you make improvements that could benefit all developers, please update the template files and submit a pull request. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## License |
| 93 | + |
| 94 | +By contributing to paimon-cpp, you agree that your contributions will be licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). |
0 commit comments