From fb70239a33d4781d268c94f365ab673d3a72bab5 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 11 May 2023 13:02:32 -0700 Subject: [PATCH 1/3] docs: explain how to find a clang-format patch generated by CI Fix #4020 --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a09ad4b991..d3dbfb61c3a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -121,6 +121,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 PRs. If the code does not comply, an artifact will be generated which is a patch file that corrects any auto-fixable formatting issues. + +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 it to your local git repo and then run `git apply [patch-file-name]`. +5. Commit and push. + ## Avoid From 0db6e5818dbab6577edbf6e1173ba4c526a06c5d Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 8 Jun 2023 17:35:57 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com> --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3dbfb61c3a..bf1138ecc02 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -121,14 +121,14 @@ 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 PRs. If the code does not comply, an artifact will be generated which is a patch file that corrects any auto-fixable formatting issues. +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 it to your local git repo and then run `git apply [patch-file-name]`. +4. Download the file to your local git repository and run `git apply [patch-file-name]`. 5. Commit and push. From 7ac63cd2aa0b53662cef05ab2e9dca2baf4a8c31 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 25 Jan 2024 14:08:53 -0800 Subject: [PATCH 3/3] Apply suggestion from @ximinez code review --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83fa1646ff5..c9e8fdfc5ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,7 +126,7 @@ 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 file to your local git repository and run `git apply [patch-file-name]`. +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: