Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | #!/bin/bash |
Anthony Barbier | 2fe7d1c | 2017-09-15 13:07:36 +0100 | [diff] [blame] | 2 | #FIXME: Remove this file before the release |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | |
| 4 | ASTYLE_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 Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 21 | DIRECTORIES="./arm_compute ./src ./examples ./tests ./utils ./support" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 22 | |
| 23 | if [ $# -eq 0 ] |
| 24 | then |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 25 | files=$(find $DIRECTORIES -type f \( -name \*.cpp -o -iname \*.h -o -name \*.inl -o -name \*.cl -o -name \*.cs \)) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 26 | else |
| 27 | files=$@ |
| 28 | fi |
| 29 | for f in $files |
| 30 | do |
Moritz Pflanzer | beabe3b | 2017-08-31 14:56:32 +0100 | [diff] [blame] | 31 | if [[ $f == *"/assembly/"* ]] |
| 32 | then |
| 33 | continue |
| 34 | fi |
| 35 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 36 | sed -i 's/\t/ /g' $f |
| 37 | clang-format -i -style=file $f |
| 38 | astyle -n -q $ASTYLE_PARAMETERS $f |
| 39 | done |