mxnet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vandana Kannan <vandana...@gmail.com>
Subject Re: Pylint Undefined variable/name error
Date Fri, 27 Jul 2018 19:00:38 GMT


On 2018/07/27 03:05:18, sandeep krishnamurthy <sandeep.krishna98@gmail.com> wrote: 
> Thanks Vandana for picking up this issue. I think this is important to be
> fixed and enabled in CI. Please let us know effort required to fix these
> issues and we all can jump in and help you.
> 
> On Thu, Jul 26, 2018, 7:27 PM Vandana Kannan <vandana268@gmail.com> wrote:
> 
> > Hi All,
> >
> > On enabling the option "undefined-variable" in pylint (in pylintrc) and
> > executing on the latest code, 52 errors show up (most of them from the
> > example folder). These could lead to Python NameError at runtime. The
> > errors are documented in
> > https://github.com/apache/incubator-mxnet/issues/11904.
> >
> > Currently, this Pylint option is disabled in CI and pylint is not executed
> > on the example folder.
> >
> > It might be better to enable this option in CI to catch these errors early
> > on, and also work on fixing the errors. Any thoughts/suggestions?
> >
> > Thanks,
> > Vandana
> >
> Thanks Sandeep. That would be great!

We could start with fixing the backlog in the example folder by checking one example at a
time. Since pylint is not enabled for these files by default, some of the examples have lint
issues other than undefined-variable too.

To execute this for a particular example on your dev machine,
1. Modify the enable section of $(ROOTDIR)/tests/ci_build/pylintrc to include "undefined-variable".
Remove “undefined-variable” from the disable section.
2. pylint --rcfile=$(ROOTDIR)/tests/ci_build/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$"
<path of the example>/*.py
Example: 
pylint --rcfile=$(ROOTDIR)/tests/ci_build/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$"
$(ROOTDIR)/example/profiler/*.py

(ROOTDIR is the path to mxnet source on your machine). This would have to be checked for Python
2 and Python 3.

Thanks,
Vandana

Mime
View raw message