File: run_pylint.sh.in

package info (click to toggle)
orca 3.30.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 45,956 kB
  • sloc: python: 38,553; sh: 609; makefile: 492
file content (31 lines) | stat: -rwxr-xr-x 1,037 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
#
# Script to run pylint on the Orca sources you've modified or added.
# See http://live.gnome.org/Orca/Pylint for more info.
#
exec_prefix=@prefix@
INSTALL_DIR=@pyexecdir@
if [ "x$*" == "x" ]
then
    if [ -d .git ]
    then
        FILES=`git status | egrep 'modified:|new file:' | grep '[.]py$' | awk '{ print $NF }'`
    else
        FILES=`svn stat src/orca | egrep '^M|^A' | grep '[.]py$' | awk '{ print $NF }'`
    fi
else
    FILES="$*"
fi
FILES=`echo $FILES | sed 's^src/orca/^^g'`
echo Thank you for your attention to quality
for foo in $FILES
do
    echo
    OUTPUT_FILE=`dirname $foo`/`basename $foo .py`.pylint
    OUTPUT_FILE=`echo $OUTPUT_FILE | sed 's~^./~~' | sed 's^/^.^g'`
    echo Checking $foo, sending output to $OUTPUT_FILE
    PYTHONPATH=$INSTALL_DIR:$PYTHONPATH pylint --init-hook="import pyatspi" $INSTALL_DIR/orca/$foo > $OUTPUT_FILE 2>&1
    grep "code has been rated" $OUTPUT_FILE | cut -f1 -d\( \
    | sed "s/.pylint:Your code has been rated at / /" \
    | sed "s^/10^^" | sort -n -k 2,2
done