Skip to content
Snippets Groups Projects
Commit 72db7d33 authored by Matthias Grob's avatar Matthias Grob Committed by Beat Küng
Browse files

astyle: fix display language dependency

The shell script which checks the style relies on greping for the
keyword "Formatted" in the output of astyle. But the program has
localization support and will output in other languages e.g. german.
This leads to all style checks always succeeding. I only tested this
on Windows in Cygwin but I can imagine the problem also exists in
non-english Ubuntu installations.

Solution is the parameter --formatted of astyle which only produces
any output if there was something to fix. This allows for a display
language independent condition for an empty string inside the shell
script.
parent 71b4ad62
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,8 @@ FILE=$1 ...@@ -4,8 +4,8 @@ FILE=$1
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
${DIR}/fix_code_style.sh --dry-run $FILE | grep --quiet Formatted CHECK_FAILED=$(${DIR}/fix_code_style.sh --dry-run --formatted $FILE)
if [[ $? -eq 0 ]]; then if [[ $CHECK_FAILED ]]; then
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty ${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment