]> SALOME platform Git repositories - modules/shaper.git/blob - findEndLines.sh
Salome HOME
Prepare a release version 9.1.0RC1
[modules/shaper.git] / findEndLines.sh
1 #!/bin/bash
2
3 FIX_LINE_ENDINGS=0
4 while [[ $# > 0 ]]; do
5   key="$1"
6   
7   case $key in
8     fix)
9       FIX_LINE_ENDINGS=1
10       shift
11       ;;
12     *)
13       shift
14       ;;
15   esac
16 done
17
18 source env.sh
19
20 find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line  --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix
21
22 WRONG=0
23 if [ -s ./tofix ]; then
24   if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then
25     python correction_auto_2.py --cpplint_output_file ./tofix
26     echo "NOTE: Line endings are fixed"
27   else
28     WRONG=1
29   fi
30 fi
31
32 rm ./tofix
33 exit $WRONG