tests/tools/check_source.sh
changeset 2408 23978e5b039a
parent 2388 13acfd8d33e6
child 2410 4e7ebd6ec248
equal deleted inserted replaced
2407:5f2b1bb464a0 2408:23978e5b039a
   244     disable=$disable,R0915        # (too-many-statements) Too many statements (57/50)
   244     disable=$disable,R0915        # (too-many-statements) Too many statements (57/50)
   245     disable=$disable,R0916        # (too-many-boolean-expressions) Too many boolean expressions in if statement (6/5)
   245     disable=$disable,R0916        # (too-many-boolean-expressions) Too many boolean expressions in if statement (6/5)
   246     disable=$disable,R0101        # (too-many-nested-blocks) Too many nested blocks (7/5)
   246     disable=$disable,R0101        # (too-many-nested-blocks) Too many nested blocks (7/5)
   247     disable=$disable,R0801        # (duplicate-code) Similar lines in N files
   247     disable=$disable,R0801        # (duplicate-code) Similar lines in N files
   248 
   248 
   249 
       
   250     enable=
   249     enable=
   251     enable=$enable,E1601          # print statement used
   250     enable=$enable,E1601          # print statement used
   252     enable=$enable,C0325          # (superfluous-parens) Unnecessary parens after keyword
   251     enable=$enable,C0325          # (superfluous-parens) Unnecessary parens after keyword
   253     enable=$enable,W0404          # reimported module
   252     enable=$enable,W0404          # reimported module
   254     enable=$enable,C0411          # (wrong-import-order) standard import "import x" comes before "import y"
   253     enable=$enable,C0411          # (wrong-import-order) standard import "import x" comes before "import y"
   259     enable=$enable,W0105          # (pointless-string-statement) String statement has no effect
   258     enable=$enable,W0105          # (pointless-string-statement) String statement has no effect
   260     enable=$enable,W0311          # (bad-indentation) Bad indentation. Found 16 spaces, expected 12
   259     enable=$enable,W0311          # (bad-indentation) Bad indentation. Found 16 spaces, expected 12
   261     enable=$enable,W0101          # (unreachable) Unreachable code
   260     enable=$enable,W0101          # (unreachable) Unreachable code
   262     enable=$enable,E0102          # (function-redefined) method already defined
   261     enable=$enable,E0102          # (function-redefined) method already defined
   263     enable=$enable,W0602          # (global-variable-not-assigned) Using global for 'X' but no assignment is done
   262     enable=$enable,W0602          # (global-variable-not-assigned) Using global for 'X' but no assignment is done
   264     enable=$enable,W0612          # (unused-variable) Unused variable 'X'
       
   265     enable=$enable,W0611          # (unused-import) Unused import X
   263     enable=$enable,W0611          # (unused-import) Unused import X
   266     enable=$enable,C1001          # (old-style-class) Old-style class defined. Problem with PyJS
   264     enable=$enable,C1001          # (old-style-class) Old-style class defined. Problem with PyJS
   267     enable=$enable,W0102          # (dangerous-default-value) Dangerous default value {} as argument
   265     enable=$enable,W0102          # (dangerous-default-value) Dangerous default value {} as argument
   268     enable=$enable,W0403          # (relative-import) Relative import 'Y', should be 'X.Y'
       
   269     enable=$enable,C0112          # (empty-docstring)
   266     enable=$enable,C0112          # (empty-docstring)
   270     enable=$enable,W0631          # (undefined-loop-variable) Using possibly undefined loop variable 'X'
   267     enable=$enable,W0631          # (undefined-loop-variable) Using possibly undefined loop variable 'X'
   271     enable=$enable,W0104          # (pointless-statement) Statement seems to have no effect
   268     enable=$enable,W0104          # (pointless-statement) Statement seems to have no effect
   272     enable=$enable,W0107          # (unnecessary-pass) Unnecessary pass statement
   269     enable=$enable,W0107          # (unnecessary-pass) Unnecessary pass statement
   273     enable=$enable,W0406          # (import-self) Module import itself
   270     enable=$enable,W0406          # (import-self) Module import itself
   280     enable=$enable,E0701          # (bad-except-order) Bad except clauses order (X is an ancestor class of Y)
   277     enable=$enable,E0701          # (bad-except-order) Bad except clauses order (X is an ancestor class of Y)
   281     enable=$enable,E0611          # (no-name-in-module) No name 'X' in module 'Y'
   278     enable=$enable,E0611          # (no-name-in-module) No name 'X' in module 'Y'
   282     enable=$enable,E0213          # (no-self-argument) Method should have "self" as first argument
   279     enable=$enable,E0213          # (no-self-argument) Method should have "self" as first argument
   283     enable=$enable,E0401          # (import-error) Unable to import 'X'
   280     enable=$enable,E0401          # (import-error) Unable to import 'X'
   284     enable=$enable,E1121          # (too-many-function-args) Too many positional arguments for function call
   281     enable=$enable,E1121          # (too-many-function-args) Too many positional arguments for function call
   285     enable=$enable,E0602          # (undefined-variable) Undefined variable 'X'
       
   286     enable=$enable,W0232          # (no-init) Class has no __init__ method
   282     enable=$enable,W0232          # (no-init) Class has no __init__ method
   287     enable=$enable,W0233          # (non-parent-init-called) __init__ method from a non direct base class 'X' is called
   283     enable=$enable,W0233          # (non-parent-init-called) __init__ method from a non direct base class 'X' is called
   288     enable=$enable,W0601          # (global-variable-undefined) Global variable 'X' undefined at the module level
   284     enable=$enable,W0601          # (global-variable-undefined) Global variable 'X' undefined at the module level
   289     enable=$enable,W0623          # (redefine-in-handler) Redefining name 'X' from outer scope (line Y) in exception handler
   285     enable=$enable,W0623          # (redefine-in-handler) Redefining name 'X' from outer scope (line Y) in exception handler
   290     enable=$enable,W0106          # (expression-not-assigned) Expression "X" is assigned to nothing
   286     enable=$enable,W0106          # (expression-not-assigned) Expression "X" is assigned to nothing
       
   287     enable=$enable,E1136          # (unsubscriptable-object) Value 'X' is unsubscriptable
       
   288     enable=$enable,E0602          # (undefined-variable) Undefined variable 'X'
       
   289     enable=$enable,W1618          # (no-absolute-import) import missing `from __future__ import absolute_import`
       
   290     enable=$enable,W0403          # (relative-import) Relative import 'Y', should be 'X.Y '
       
   291     enable=$enable,W0612          # (unused-variable) Unused variable 'X'
   291     enable=$enable,C0330          # (bad-continuation) Wrong hanging indentation before block
   292     enable=$enable,C0330          # (bad-continuation) Wrong hanging indentation before block
   292     enable=$enable,E1136          # (unsubscriptable-object) Value 'X' is unsubscriptable
       
   293     enable=$enable,W1618          # (no-absolute-import) import missing `from __future__ import absolute_import`
       
   294     # enable=
   293     # enable=
   295 
   294 
   296     options=
   295     options=
   297     options="$options --rcfile=.pylint"
   296     options="$options --rcfile=.pylint"
   298     # options="$options --py3k"   # report errors for Python 3 porting
   297     # options="$options --py3k"   # report errors for Python 3 porting
   315 }
   314 }
   316 
   315 
   317 
   316 
   318 get_files_to_check()
   317 get_files_to_check()
   319 {
   318 {
   320     py_files=$(find . -name '*.py' -not -path '*/build/*' -not -path './etherlab/*')
   319     py_files=$(find . -name '*.py' -not -path '*/build/*')
   321     if [ -e .hg/skiphook ]; then
   320     if [ -e .hg/skiphook ]; then
   322 	echo "Skipping checks in the hook ..."
   321 	echo "Skipping checks in the hook ..."
   323 	exit 0
   322 	exit 0
   324     fi
   323     fi
   325     if [ "$1" = "--only-changes" ]; then
   324     if [ "$1" = "--only-changes" ]; then