Skip to content

Add pre-commit instructions to CONTRIBUTING.md #1606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,23 @@ 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
```
./clang/tools/clang-format/git-clang-format `git merge-base origin/sycl HEAD`
```
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`
- 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

Expand Down