blob: 2ab3c1d532ed670a8b5827f8f9d437dfa08f0a03 [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001#!/bin/bash
2
3ASTYLE_PARAMETERS=" --style=ansi \
4 --indent=spaces \
5 --indent-switches \
6 --indent-col1-comments \
7 --min-conditional-indent=0 \
8 --max-instatement-indent=120 \
9 --pad-oper \
10 --align-pointer=name \
11 --align-reference=name \
12 --break-closing-brackets \
13 --keep-one-line-statements \
14 --max-code-length=200 \
15 --mode=c \
16 --lineend=linux \
17 --indent-preprocessor \
18 "
19
20DIRECTORIES="./arm_compute ./src ./examples ./tests ./utils"
21
22if [ $# -eq 0 ]
23then
24 files=$(find $DIRECTORIES -type f \( -name \*.cpp -o -iname \*.h -o -name \*.inl -o -name \*.cl \))
25else
26 files=$@
27fi
28for f in $files
29do
30 sed -i 's/\t/ /g' $f
31 clang-format -i -style=file $f
32 astyle -n -q $ASTYLE_PARAMETERS $f
33done