#!/bin/bash
#
# $1 -- python source to run pylint on
#

if [ $# -lt 1 ]; then
    # no source, just exit
    exit 1
fi

file_suffix="$(eval echo \$$#|sed s?/?_?g)"

pylint_output="$(pylint \
    --msg-template='{msg_id}:{line:3d},{column}: {obj}: {msg}' \
    -r n --disable=C,R --rcfile=/dev/null \
    --dummy-variables-rgx=_ \
    --ignored-classes=Popen,TransactionSet \
    --defining-attr-methods=__init__,_grabObjects,initialize,reset,start,setUp \
    --load-plugins=intl \
    $DISABLED_WARN_OPTIONS \
    $DISABLED_ERR_OPTIONS \
    $NON_STRICT_OPTIONS "$@" 2>&1 | \
    egrep -v -f "$FALSE_POSITIVES" \
    )"

# I0011 is the informational "Locally disabling ...." message
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 $(eval echo \$$#)|")"
    echo "$pylint_output" > pylint-out_$file_suffix
    touch "pylint-$file_suffix-failed"
fi

#!/bin/bash
#
# $1 -- python source to run pylint on
#

if [ $# -lt 1 ]; then
    # no source, just exit
    exit 1
fi

file_suffix="$(eval echo \$$#|sed s?/?_?g)"

pylint_output="$(pylint \
    --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' \
    -r n --disable=C,R --rcfile=/dev/null \
    --dummy-variables-rgx=_ \
    --ignored-classes=Popen,TransactionSet \
    --defining-attr-methods=__init__,_grabObjects,initialize,reset,start,setUp \
    --load-plugins=intl \
    $DISABLED_WARN_OPTIONS \
    $DISABLED_ERR_OPTIONS \
    $NON_STRICT_OPTIONS "$@" 2>&1 | \
    egrep -v -f "$FALSE_POSITIVES" \
    )"

# I0011 is the informational "Locally disabling ...." message
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 $(eval echo \$$#)|")"
    echo "$pylint_output" > pylint-out_$file_suffix
    touch "pylint-$file_suffix-failed"
fi

Change output format so that it is suitable for diff-cover.
Change output format so that it is suitable for diff-cover.

The diff-cover instructions require setting --output-format to
parseable, but apparently that option is now obsolete.

Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>
