From f42fb7ca7e1ae107898a0c74202312185907cdc4 Mon Sep 17 00:00:00 2001 From: hiaselhans Date: Wed, 29 Apr 2020 09:45:08 +0200 Subject: [PATCH 1/3] Add pre-commit instructions to CONTRIBUTING.md Signed-off-by: hiaselhans --- CONTRIBUTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 292ed21176012..c2a8c488cff24 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,6 +93,23 @@ for more information. commit message title. To a reasonable extent, additional tags can be used to signify the component changed, e.g.: `[PI]`, `[CUDA]`, `[Doc]`. +### Pre-commit checks + +- Before submitting your patch you can verify coding-style conformance with the clang-format tool: + ``` + git diff -U0 sycl~0 --no-color -- | ./clang/tools/clang-format/clang-format-diff.py -p1 + ``` + make sure clang-format is installed on your system + +- You can also run the sycl test-suite before sending your PR: + + - complete test suite: `python buildbot/check.py` + - sycl test suite `python buildbot/check.py -t test-sycl` + - run only "mytest" test `python buildbot/check.py -t test-sycl-mytest` + + if necessary, use `-o $LLVM_BUILD_DIR` to specify the llvm build directory + + ### Review and acceptance testing - Create a pull request for your changes following [Creating a pull request From d058a96b2324d9737190aa7fbef0703759930be1 Mon Sep 17 00:00:00 2001 From: hiaselhans Date: Wed, 29 Apr 2020 11:32:49 +0200 Subject: [PATCH 2/3] remove 'pre-commit' and integrate into 'development' block Signed-off-by: hiaselhans --- CONTRIBUTING.md | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2a8c488cff24..703597da606a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,12 +77,21 @@ for more information. - Create a personal fork of the project on GitHub - For the DPC++ Compiler project, use **sycl** branch as baseline for your changes. See [Get Started Guide](sycl/doc/GetStartedGuide.md). -- Prepare your patch (follow - [LLVM coding standards](https://llvm.org/docs/CodingStandards.html)). - [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [clang-tidy]( - https://clang.llvm.org/extra/clang-tidy/) tools can be integrated into your - workflow to ensure formatting and stylistic compliance of your changes. +- Prepare your patch + - follow [LLVM coding standards](https://llvm.org/docs/CodingStandards.html) + - [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and + [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) tools can be integrated into your + workflow to ensure formatting and stylistic compliance of your changes. + - use + ``` + git diff -U0 sycl~0 --no-color -- | ./clang/tools/clang-format/clang-format-diff.py -p1 + ``` + to check the format of your current changes against the `sycl` branch - Build the project and run all tests. + - complete test suite: `python buildbot/check.py` + - sycl test suite `python buildbot/check.py -t test-sycl` + - run only "mytest" test `python buildbot/check.py -t test-sycl-mytest` + - if necessary, use `-o $LLVM_BUILD_DIR` to specify the llvm build directory ### Commit message @@ -93,23 +102,6 @@ for more information. commit message title. To a reasonable extent, additional tags can be used to signify the component changed, e.g.: `[PI]`, `[CUDA]`, `[Doc]`. -### Pre-commit checks - -- Before submitting your patch you can verify coding-style conformance with the clang-format tool: - ``` - git diff -U0 sycl~0 --no-color -- | ./clang/tools/clang-format/clang-format-diff.py -p1 - ``` - make sure clang-format is installed on your system - -- You can also run the sycl test-suite before sending your PR: - - - complete test suite: `python buildbot/check.py` - - sycl test suite `python buildbot/check.py -t test-sycl` - - run only "mytest" test `python buildbot/check.py -t test-sycl-mytest` - - if necessary, use `-o $LLVM_BUILD_DIR` to specify the llvm build directory - - ### Review and acceptance testing - Create a pull request for your changes following [Creating a pull request From 9b137f4d21763209c0b18b83d63bd53107ae6b08 Mon Sep 17 00:00:00 2001 From: hiaselhans Date: Wed, 29 Apr 2020 13:17:09 +0200 Subject: [PATCH 3/3] use git-clang-format tool Signed-off-by: hiaselhans --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 703597da606a7..0995f5734261f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,9 +84,11 @@ for more information. workflow to ensure formatting and stylistic compliance of your changes. - use ``` - git diff -U0 sycl~0 --no-color -- | ./clang/tools/clang-format/clang-format-diff.py -p1 + ./clang/tools/clang-format/git-clang-format `git merge-base origin/sycl HEAD` ``` - to check the format of your current changes against the `sycl` branch + to check the format of your current changes against the `origin/sycl` branch. + - `-f` to also correct unstaged changes + - `--diff` to only print the diff without applying - Build the project and run all tests. - complete test suite: `python buildbot/check.py` - sycl test suite `python buildbot/check.py -t test-sycl`