2020-06-14 05:53:54 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# Formats all source files.
|
|
|
|
|
|
|
|
set +e
|
|
|
|
td="$(dirname $0)/.."
|
|
|
|
|
|
|
|
function find_cc_sources() {
|
|
|
|
local dir="$1"
|
|
|
|
find "$dir" -name "*.h"
|
|
|
|
find "$dir" -name "*.cpp"
|
|
|
|
}
|
|
|
|
# C/C++ sources.
|
|
|
|
set -o xtrace
|
|
|
|
clang-format -i \
|
|
|
|
$(find_cc_sources include) \
|
|
|
|
$(find_cc_sources lib) \
|
2020-09-26 09:13:16 +08:00
|
|
|
$(find_cc_sources frontends/pytorch/csrc)
|
2020-06-14 05:53:54 +08:00
|
|
|
|
|
|
|
# Python sources.
|
|
|
|
yapf --recursive -i "$td/python" "$td/pytest"
|