diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 75616eb6b4e..5355878fa79 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,6 +119,16 @@ this: You can format individual files in place by running `clang-format -i ...` from any directory within this project. +There is a Continuous Integration job that runs clang-format on pull requests. If the code doesn't comply, a patch file that corrects auto-fixable formatting issues is generated. + +To download the patch file: + +1. Next to `clang-format / check (pull_request) Failing after #s` -> click **Details** to open the details page. +2. Left menu -> click **Summary** +3. Scroll down to near the bottom-right under `Artifacts` -> click **clang-format.patch** +4. Download the zip file and extract it to your local git repository. Run `git apply [patch-file-name]`. +5. Commit and push. + You can install a pre-commit hook to automatically run `clang-format` before every commit: ``` pip3 install pre-commit