-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathformat.sh
More file actions
36 lines (31 loc) · 777 Bytes
/
format.sh
File metadata and controls
36 lines (31 loc) · 777 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
31
32
33
34
35
36
#!/bin/bash
# Requires: clang-format, yapf, isort, shfmt
set -e
cd "${0%/*}"
which clang-format
find \( \
-path './backend/clang' -or \
-path './backend/python/tapa/assets/clang' -or \
-path './regression' -or \
-path '*/build' \
\) -prune -or \( \
-iname '*.h' -or -iname '*.cpp' \
\) -print0 | xargs --null clang-format -i --verbose
which yapf
which isort
find \( \
-path './backend/python/tapa/verilog/axi_xbar.py' -or \
-path './regression' -or \
-path '*/build' \
\) -prune -or \( \
-iname '*.py' \
\) \
-execdir yapf --in-place --verbose '{}' ';' \
-execdir isort '{}' ';'
which shfmt
find \( \
-path './regression' -or \
-path '*/build' \
\) -prune -or \( \
-iname '*.sh' \
\) -print0 | xargs --null shfmt --write --indent=2