X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=findEndLines.sh;h=eb3c0cc70b06ba0d3859f675a6d0dbc04af9f94f;hb=6d1218b0c0c5e83c4303671c5dcde3c8821ed623;hp=b6e51e28224ecdcdbc71f9b70f11073a6ad45b26;hpb=423c10234142d14d0d5de89383f2f96a4ec5930f;p=modules%2Fshaper.git diff --git a/findEndLines.sh b/findEndLines.sh index b6e51e282..eb3c0cc70 100755 --- a/findEndLines.sh +++ b/findEndLines.sh @@ -1,7 +1,33 @@ #!/bin/bash +FIX_LINE_ENDINGS=0 +while [[ $# > 0 ]]; do + key="$1" + + case $key in + fix) + FIX_LINE_ENDINGS=1 + shift + ;; + *) + shift + ;; + esac +done + +source env.sh + 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 -python correction_auto_2.py --cpplint_output_file ./tofix +WRONG=0 +if [ -s ./tofix ]; then + if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then + python correction_auto_2.py --cpplint_output_file ./tofix + echo "NOTE: Line endings are fixed" + else + WRONG=1 + fi +fi -rm ./tofix \ No newline at end of file +rm ./tofix +exit $WRONG