Closed vandanavk closed 6 years ago
Thanks. I am learning more about pylint from your approach here.
l’m using Python2
Have you tried doing python3 -m pylint ... ?
basestring, long, raw_input, unicode, xrange, etc. are defined names in Python 2 but not in Python 3.
@cclauss I tried Python3 too. The only difference I saw was that the undefined errors related to exceptions didn't occur.
Fixes for 30 errors have been merged.
The ones remaining are:
Code/module affected | Undefined variable |
---|---|
./example/deep-embedded-clustering/model.py:25:8: | ModuleNotFoundError |
./example/neural-style/end_to_end/model_vgg19.py:94:17: | out |
./example/neural-style/end_to_end/model_vgg19.py:105:16: | out |
./example/profiler/profiler_executor.py:89:15: | search_plan |
./example/profiler/profiler_executor.py:89:37: | data_shapes |
./example/reinforcement-learning/a3c/a3c.py:206:16: | robo_data |
./example/sparse/factorization_machine/metric.py:111:22: | label_zero_num |
./example/sparse/factorization_machine/metric.py:111:39: | label_one_num |
./docs/mxdoc.py:75:16: | root_path | PR https://github.com/apache/incubator-mxnet/pull/11990 ./tools/flakiness_checker.py:69:11: | FileNotFoundError | PR https://github.com/apache/incubator-mxnet/pull/11991 Plus PR https://github.com/apache/incubator-mxnet/pull/11982
flake8 (on Python 3) moved from finding 22 undefined names down to 19. https://github.com/apache/incubator-mxnet/issues/8270#issuecomment-411455720
ModuleNotFoundError was added in Python 3.6 so this will be raised if pylint (or flake8) is running on Python <3.6. Change ModuleNotFoundError to ImportError to be compatible with all currently supported versions of Python.
All the errors in this list have been fixed. Closing this bug.
Pylint finds no undefined names when running on Python 2 and when running on Python 3?
The more recent lint scans that I've been doing are with Python3 - didn't find any new errors.
See #12200 !!
PyLint is not currently configured to find issues with Python files in ./amalgamation, ./tests, etc...
Description
Running Pylint on incubator-mxnet with undefined-variable enabled, results in 52 errors. This could lead to NameError on execution.
Steps to reproduce
Package used (Python/R/Scala/Julia): I'm using Python2
Build info (Required if built from source)
MXNet commit hash: f5b95b090815e879b57dca233604dcb3f1df967a
Error Message:
What have you tried to solve it?