File: format-sources.sh

package info (click to toggle)
eckit 1.32.4-2
  • links: PTS
  • area: main
  • in suites: forky
  • size: 600,644 kB
  • sloc: cpp: 111,654; ansic: 2,826; yacc: 590; lex: 361; python: 237; sh: 202; makefile: 41
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