Closed cclauss closed 5 years ago
Thanks for pointing out the style issue. How does flake8 compare with pylint? Also, some F821 errors are due to the CAPI calls, for example:
./python/dgl/runtime/degree_bucketing.py:100:15: F821 undefined name '_CAPI_DGLDegreeBucketing'
buckets = _CAPI_DGLDegreeBucketing(mids.todgltensor(), dsts.todgltensor(),
Here, _CAPI_DGLDegreeBucketing
is dynamically registered from the c lib.
These are not style issues. NameErrors have the potential to halt the runtime.
Just add global _CAPI_DGLDegreeBucketing to help linters (and humans) understand what is going on.
flake8 and PyLint are both linters but my experience is that flake8 with these five tests finds a lot of issues that PyLint misses.
Hi @cclauss , I put an item in our roadmap issue #302 . We will include this fix in this cycle. Feel free to comment there. Thank you!
It might be useful to add the flake8 command below to the Jenkins test runs.
The torch, sp, np, and mx issues are probably missing imports...
E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
name
name
in__all__
flake8 testing of https://github.com/dmlc/dgl on Python 3.7.1
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics