blob: 5ceeb067946309bac52f7754ab0cb90eef8bcad3 [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
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010020DIRECTORIES="./arm_compute ./src ./examples ./tests ./utils ./framework ./support"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010021
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