Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 8ce97ae

Browse files
author
HYChang
committed
fix(Endpoint): Ignore to format legato project
The autoformat hook doesn't need to format the legato project. Add the hooks/format-exclude-list for skip the directory which doesn't need to format by clang-format. Close #713
1 parent 6535f37 commit 8ce97ae

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

hooks/format-exclude-list

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
third_party
2+
output_base
3+
legato
4+
_build_endpoint

hooks/formatter

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
for file in $(find $(git rev-parse --show-toplevel) | egrep "\.(c|cc|cpp|h|hh|hpp|m|mm)\$" | egrep -v "third_party|output_base");
3+
for file in $(find $(git rev-parse --show-toplevel) | egrep "\.(c|cc|cpp|h|hh|hpp|m|mm)\$" | egrep -v -f hooks/format-exclude-list)
44
do
55
clang-format -style=file -fallback-style=none -i $file
66
done
77

8-
for file in $(find $(git rev-parse --show-toplevel) | egrep "\BUILD\$" | egrep -v "third_party|output_base" )
8+
for file in $(find $(git rev-parse --show-toplevel) | egrep "\BUILD\$" | egrep -v -f hooks/format-exclude-list )
99
do
1010
buildifier $file
1111
done

0 commit comments

Comments
 (0)