Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1118245 - clang-format CI follow-up, r=ttaubert
--HG--
extra : amend_source : ec2a52c99dce754584d9a35134bdbc88414d05ce
  • Loading branch information
franziskuskiefer committed May 9, 2017
1 parent f60362e commit d2ec59c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions automation/taskcluster/scripts/run_clang_format.sh
Expand Up @@ -28,7 +28,7 @@ cd "$top"
if [ $# -gt 0 ]; then
dirs=("$@")
else
dirs=($(find . ! -path . \( ! -regex '.*/' \) -type d -maxdepth 2 -mindepth 2))
dirs=($(find . ! -path . \( ! -regex '.*/' \) -maxdepth 2 -mindepth 1 -type d))
fi

format_folder()
Expand All @@ -44,8 +44,13 @@ format_folder()

for dir in "${dirs[@]}"; do
if format_folder "$dir" ; then
c="${dir//[^\/]}"
echo "formatting $dir ..."
find "$dir" -type f \( -name '*.[ch]' -o -name '*.cc' \) -exec clang-format -i {} \+
depth=""
if [ "${#c}" == "1" ]; then
depth="-maxdepth 1"
fi
find "$dir" $depth -type f \( -name '*.[ch]' -o -name '*.cc' \) -exec clang-format -i {} \+
fi
done

Expand Down

0 comments on commit d2ec59c

Please sign in to comment.