-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathformat.sh
More file actions
executable file
·30 lines (23 loc) · 811 Bytes
/
format.sh
File metadata and controls
executable file
·30 lines (23 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Script to run clang-format on all .c and .h files in project source directories
# Covers main/ and first-party components (excludes libwally-core)
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DIRS=(
"$SCRIPT_DIR/main"
"$SCRIPT_DIR/components/bbqr"
"$SCRIPT_DIR/components/cUR"
"$SCRIPT_DIR/components/k_quirc"
"$SCRIPT_DIR/components/sd_card"
"$SCRIPT_DIR/components/video"
"$SCRIPT_DIR/components/waveshare_bsp"
)
echo "Running clang-format on project source files..."
for dir in "${DIRS[@]}"; do
if [ ! -d "$dir" ]; then
echo "Warning: $dir not found, skipping"
continue
fi
find "$dir" -type f \( -name "*.c" -o -name "*.h" \) -not -path "*/build/*" -exec clang-format -i {} \;
done
echo "Formatting complete!"