Skip to content

Commit 8ca8ba5

Browse files
committed
advertise .clang-format-ignore
1 parent 50a5250 commit 8ca8ba5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.clang-format-ignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ignore third_party code from clang-format checks
2+
src/third_party/*

README.rst

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ It's possible to exclude paths from the recursive search::
3636
--exclude '*_test.cpp' \
3737
src include foo.cpp
3838

39+
These exclude rules can be put in a ``.clang-format-ignore`` file,
40+
which also supports comments.
41+
42+
An example configuration is available in this repo::
43+
44+
$ cat .clang-format-ignore (master)*
45+
# ignore third_party code from clang-format checks
46+
src/third_party/*
47+
3948

4049
Continuous integration
4150
======================

src/third_party/qux.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This code is ignored by the .clang-format-ignore file.
2+
3+
int qux (bool cond) {
4+
if(cond){
5+
return - 1;
6+
}
7+
8+
return 0;
9+
}

0 commit comments

Comments
 (0)