blob: 021f92516f14ed9f5d99dfbcea398e910e6cddfa [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
Anthony Barbier7068f992017-10-26 15:23:08 +010025 files=$(find $DIRECTORIES -type f \( -name \*.cpp -o -iname \*.h -o -name \*.inl -o -name \*.cl -o -name \*.cs \))
Anthony Barbier6ff3b192017-09-04 18:44:23 +010026else
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +000027 files=$@
Anthony Barbier6ff3b192017-09-04 18:44:23 +010028fi
29for f in $files
30do
Moritz Pflanzerbeabe3b2017-08-31 14:56:32 +010031 if [[ $f == *"/assembly/"* ]]
32 then
33 continue
34 fi
35
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +000036 sed -i 's/\t/ /g' $f
37 clang-format -i -style=file $f
38 astyle -n -q $ASTYLE_PARAMETERS $f
Anthony Barbier6ff3b192017-09-04 18:44:23 +010039done