Skip to content

Commit a024ac2

Browse files
committed
Fixed format to ignore tests data and scripts
1 parent 31610b8 commit a024ac2

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

tools/format.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,21 @@ fi
1010

1111
set -e
1212

13-
FIND="find . -name third_party -prune -o -name tools -prune -o -name .git -prune -o -name _deps -prune -o -name .build -prune -o -name out -prune -o -name .vs -prune -o -name opentelemetry_logo.png -prune -o -name TraceLoggingDynamic.h -prune -o"
13+
FIND="find . -name third_party -prune -o"
14+
FIND="${FIND} -name tools -prune -o"
15+
FIND="${FIND} -name .git -prune -o"
16+
FIND="${FIND} -name _deps -prune -o"
17+
FIND="${FIND} -name .build -prune -o"
18+
FIND="${FIND} -name out -prune -o"
19+
FIND="${FIND} -name .vs -prune -o"
20+
FIND="${FIND} -name opentelemetry_logo.png -prune -o"
21+
FIND="${FIND} -name TraceLoggingDynamic.h -prune -o"
22+
# Do not format yaml files
23+
FIND="${FIND} -name \"*.yaml\" -prune -o"
24+
# Do not format shelltest files
25+
FIND="${FIND} -name \"*.test\"-prune -o"
26+
# Do not format patch files
27+
FIND="${FIND} -name \"*.patch\"-prune -o"
1428

1529
# GNU syntax.
1630
SED=(sed -i)
@@ -23,8 +37,8 @@ fi
2337
# No CRLF line endings, except Windows files.
2438
"${SED[@]}" 's/\r$//' $($FIND -name '*.ps1' -prune -o \
2539
-name '*.cmd' -prune -o -type f -print)
26-
# No trailing spaces, except in patch.
27-
"${SED[@]}" 's/ \+$//' $($FIND -name "*.patch" -prune -o -type f -print)
40+
# No trailing spaces.
41+
"${SED[@]}" 's/ \+$//' $($FIND -type f -print)
2842

2943
# If not overridden, try to use clang-format-18 or clang-format.
3044
if [[ -z "$CLANG_FORMAT" ]]; then

0 commit comments

Comments
 (0)