From: azv Date: Wed, 30 Nov 2016 05:40:10 +0000 (+0300) Subject: Add key for automatic fixing of line endings X-Git-Tag: V_2.6.0~34^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b3c4a3a5474d302a55082bb7f896745a0d9e8bf;p=modules%2Fshaper.git Add key for automatic fixing of line endings --- diff --git a/findEndLines.sh b/findEndLines.sh index 4f3a19fa6..eb3c0cc70 100755 --- a/findEndLines.sh +++ b/findEndLines.sh @@ -1,9 +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 +exit $WRONG