Skip to content

Commit 57b10ae

Browse files
bors[bot]tschwinge
andauthored
Merge #795
795: Running `clang-format` locally [#242] r=philberty a=tschwinge Apparently everyone but me knows how to do that; I'm now documenting it for my own future use. Co-authored-by: Thomas Schwinge <[email protected]>
2 parents 57c3131 + c936060 commit 57b10ae

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/clang-format.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16+
# If updating these steps, please also correspondingly update '../../CONTRIBUTING.md', "Running `clang-format` locally".
1617
- uses: actions/checkout@v2
1718
- name: Copy .clang-format file
1819
run: cp contrib/clang-format .clang-format

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ These will be imported into a GitHub PR to follow the normal review process, and
4040

4141
* Where possible please add test cases to `gcc/testsuite/rust/` for all PRs. Some issues may not be testable via dejagnu/automation such as debug dump changes.
4242

43-
* PR's cannot be merged untill clang format and the build and tests pass.
43+
* PRs won't be merged until `clang-format` and the build and tests pass.
44+
45+
** Running `clang-format` locally
46+
47+
... corresponding to what the _Clang Format Lint_ (`.github/workflows/clang-format.yml`) is doing, with `clang-format-10` being available locally, and avoiding the Docker overhead.
48+
49+
$ wget 'https://github.com/DoozyX/clang-format-lint-action/raw/v0.11/run-clang-format.py'
50+
$ cp contrib/clang-format .clang-format
51+
$ python3 run-clang-format.py --clang-format-executable clang-format-10 --recursive --extensions h,cc gcc/rust/
4452

4553
* Please take the time to create good git commit messages see the existing format of them in the git log or refer to something like: https://chris.beams.io/posts/git-commit/
4654

0 commit comments

Comments
 (0)