File: reformat_all_sources.sh

package info (click to toggle)
geogram 1.9.6-1
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 15,436 kB
  • sloc: cpp: 143,890; ansic: 10,098; perl: 1,430; sh: 1,199; yacc: 522; lex: 182; python: 157; javascript: 149; makefile: 17
file content (20 lines) | stat: -rwxr-xr-x 567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

BASEDIR=$(dirname "$0")

# Already done in indent_with_emace.sh, kept here if
# we just need to do that
function untabify_and_remove_trailing_spaces() {
    cat $1.unformatted | sed -e 's|\t|    |g' -e 's|\s\+$||g' > $1
}

function reformat() {
    echo '>>> reformatting ' $1
    cp $1 $1.before_reformatting
    $BASEDIR/indent_with_emacs.sh $1
}

for i in `find . \( -name third_party -o -name "embedded_*.cpp" -o -name "sphere_model.cpp" \) -prune \\
         -o \( -name "*.h" -o -name "*.cpp" -o -name "*.c" -o -name "*.txt" \) -print`
do
    reformat $i
done