This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
We welcome contributions from everyone. The following guidelines will help you understand our expectations and streamline the review process.
We follow the LLVM coding style for all C/C++ code. Please ensure your code conforms to this style. To automate this process, we use clang-format
:
clang-format -i path/to/your/file.cpp
It is recommended to install the Clang-Format extension in Visual Studio Code to format your code automatically.
Please follow these guidelines for commit messages:
- Use the present tense ("Add feature" not "Added feature").
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...").
- Limit the first line to 72 characters or less.
- Reference issues and pull requests liberally.
We use pre-commit hooks to ensure code quality and consistency. These hooks will check your code for proper formatting before allowing a commit.
-
Install the pre-commit package, for example, in Ubuntu you can run:
sudo apt install pre-commit
-
Install the pre-commit hooks:
pre-commit install --hook-type commit-msg pre-commit install
-
Manually run the hooks on all files (optional but recommended for first-time setup):
pre-commit run --all-files
-
Auto Format when you commit:
export AUTO_FORMAT=1
-
Install cppcheck:
sudo apt-get install cppcheck
-
Disable cppcheck:
export DISABLE_CPPCHECK=1
- Ensure your code follows the style guide and passes all tests.
- Commit your changes with a descriptive commit message.
- Push your changes to your fork:
git push origin your-branch
- Create a pull request against the
main
branch of the upstream repository.
In your pull request, please include:
- A descriptive title and detailed description of the changes.
- Reference any relevant issues or pull requests.