Changed the accepted and rejected list to redirect to the review page in ListProposal...
[Melange.git] / scripts / pylint / do_pylint.sh
blob99b48a5635a29d3b59e17214f0f43cfe5b73d7cc
1 #!/bin/bash
2 # Copyright 2008 the Melange authors.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # Set some environmental variables for pylint and run it on Melange code
17 # To disable some of the checks use options listed below:
18 # disable unused imports: --disable-msg=W0611
19 # disable TODO: --disable-msg=W0511
20 # disable cyclic imports: --disable-msg=R0401
21 # disable report: --reports=no
22 # disable similarity check: --disable-checker=similarities
24 # Checks listed above are disabled in silent mode
25 # which can be run using --silent argument
27 SILENT_ARGS=""
28 ARGS=( "$@" )
30 if [ "$1" == "--silent" ]; then
31 SILENT_ARGS="--disable-msg=W0511,R0401 --reports=no --disable-checker=similarities"
32 ARGS[0]=""
35 PROJ_DIR=$(dirname "$0")/../..
36 PROJ_DIR=$(cd "$PROJ_DIR"; pwd)
37 APP_DIR="${PROJ_DIR}/app"
39 # Note: We will add ghop and gsoc modules once there something in there
40 CHECK_MODULES="soc reflistprop settings.py urls.py main.py"
42 PYLINTRC=$(dirname "$0")/pylintrc
43 PYTHONPATH="${PYTHONPATH}:${PROJ_DIR}/app/:${PROJ_DIR}/thirdparty/google_appengine/"
45 export PYTHONPATH
46 export PYLINTRC
48 PYLINT_PATH=$(which pylint)
50 if [ "$PYLINT_PATH" = "" ]; then
51 echo >&2 "Cannot find pylint. Make sure pylint is in your PATH variable."
52 exit 1
55 CHECK_MODULES_PATHS=""
57 for x in $CHECK_MODULES
59 CHECK_MODULES_PATHS="${CHECK_MODULES_PATHS} ${APP_DIR}/${x}"
60 done
62 pylint $SILENT_ARGS $ARGS $CHECK_MODULES_PATHS