blob: a07d2615afad7e6b8e59642d91ce3b62fd8ef557 [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001#!/bin/bash
Anthony Barbier2fe7d1c2017-09-15 13:07:36 +01002#FIXME: Remove this file before the release
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003
4ASTYLE_PARAMETERS=" --style=ansi \
5 --indent=spaces \
6 --indent-switches \
7 --indent-col1-comments \
8 --min-conditional-indent=0 \
9 --max-instatement-indent=120 \
10 --pad-oper \
11 --align-pointer=name \
12 --align-reference=name \
13 --break-closing-brackets \
14 --keep-one-line-statements \
15 --max-code-length=200 \
16 --mode=c \
17 --lineend=linux \
18 --indent-preprocessor \
19 "
20
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010021DIRECTORIES="./arm_compute ./src ./examples ./tests ./utils ./support"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010022
23if [ $# -eq 0 ]
24then
25 files=$(find $DIRECTORIES -type f \( -name \*.cpp -o -iname \*.h -o -name \*.inl -o -name \*.cl \))
26else
27 files=$@
28fi
29for f in $files
30do
Moritz Pflanzerbeabe3b2017-08-31 14:56:32 +010031 if [[ $f == *"/assembly/"* ]]
32 then
33 continue
34 fi
35
Anthony Barbier6ff3b192017-09-04 18:44:23 +010036 sed -i 's/\t/ /g' $f
37 clang-format -i -style=file $f
38 astyle -n -q $ASTYLE_PARAMETERS $f
39done