[PATCH] Fix logging of pylint-one output

Vratislav Podzimek vpodzime at redhat.com
Tue Nov 19 06:07:10 UTC 2013


On Mon, 2013-11-18 at 12:42 -0800, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> ---
>  tests/pylint/pylint-one.sh |  7 +------
>  tests/pylint/runpylint.sh  | 16 +++++++++-------
>  2 files changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/tests/pylint/pylint-one.sh b/tests/pylint/pylint-one.sh
> index 05532e2..58cc2b5 100755
> --- a/tests/pylint/pylint-one.sh
> +++ b/tests/pylint/pylint-one.sh
> @@ -10,8 +10,6 @@ fi
>  
>  file_suffix="$(echo $1|sed s?/?_?g)"
>  
> -exec > pylint-out_$file_suffix
> -
>  pylint_output="$(pylint \
>      --msg-template='{msg_id}:{line:3d},{column}: {obj}: {msg}' \
>      -r n --disable=C,R --rcfile=/dev/null \
> @@ -30,9 +28,6 @@ if [ -n "$(echo "$pylint_output" | fgrep -v '************* Module ' |\
>            grep -v '^I0011:')" ]; then
>      # Replace the Module line with the actual filename
>      pylint_output="$(echo "$pylint_output" | sed "s|\* Module .*|* Module $1|")"
> -
> -    if [ "$pylint_log" -ne 0 ]; then
> -        echo "$pylint_output" > pylint-out_$file_suffix
> -    fi
> +    echo "$pylint_output" > pylint-out_$file_suffix
>      touch "pylint-$file_suffix-failed"
>  fi
> diff --git a/tests/pylint/runpylint.sh b/tests/pylint/runpylint.sh
> index 050e58e..e3c8a67 100755
> --- a/tests/pylint/runpylint.sh
> +++ b/tests/pylint/runpylint.sh
> @@ -77,6 +77,10 @@ fi
>  
>  exit_status=0
>  
> +if [ -s pylint-log ]; then
> +    rm pylint-log
> +fi
> +
>  # run pylint one file / module at a time, otherwise it sometimes gets
>  # confused
>  if [ -z "$FILES" ]; then
> @@ -101,13 +105,11 @@ else
>      exit_status=1
>  fi
>  
> -if [ "$pylint_log" -ne 0 ]; then
> -    if [ -s pylint-log ]; then
> -        echo "pylint reports the following issues:"
> -        cat pylint-log
> -    else
> -        rm pylint-log
> -    fi
> +if [ -s pylint-log ]; then
> +    echo "pylint reports the following issues:"
> +    cat pylint-log
> +elif [ -e pylint-log ]; then
> +    rm pylint-log
>  fi
>  
>  exit "$exit_status"
ACK, thanks!

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list