File: format-sources.sh

package info (click to toggle)
eckit 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,044 kB
  • sloc: cpp: 111,103; ansic: 2,826; yacc: 590; lex: 361; python: 302; sh: 162; makefile: 53
file content (13 lines) | stat: -rwxr-xr-x 574 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash

# Usage: find . -iname "*.h" -or -iname "*.cc" -exec ./format-sources.sh {} \;

for f in $@
do
    # apply clang-format file .clang-format in top dir
    clang-format -i -style=file -fallback-style=none $f

    # divider lines with 120 chars
    perl -pi -e 's#^//-+$#//----------------------------------------------------------------------------------------------------------------------#g' $f
    perl -pi -e 's#^//=+$#//----------------------------------------------------------------------------------------------------------------------#g' $f
done