pylint warnings
Issue #436
resolved
Wondering whether we can get rid of
# pylint: disable=invalid-name, no-name-in-module, no-member
by being even smarter about python wrapper
Tagging @thduynguyen and @matt_broadway
Comments (4)
-
-
reporter I'm think we will continue as-is and write the
# pylint: disable=
declaration in each file. Will close issue. -
reporter Thanks for the excellent info, though!!!
-
reporter - changed status to resolved
Decided to stick w status-quo.
- Log in to comment
these look more like bugs/limitations of pylint.
no-name-in-module
is because the gtsam module imports everything from the shared library file. It was decided that pylint shouldn't load shared libraries by default for security reasons: https://stackoverflow.com/questions/28437071/pylint-1-4-reports-e1101no-member-on-all-c-extensionsindividual users should be able to put the following in their
.pylintrc
or pass--extension-pkg-whitelist=gtsam
(or the more heavy handed--unsafe-load-any-extension=y
) at the command line, but for some reason this didn't work for me.I didn't get any
no-member
warnings in my testinginvalid-name
is because the camel case naming convention that GTSAM uses isn't pep8 (which requires snake case). Perhaps the wrapper could automatically convert names from camel case to snake case? but then users may have a harder time googling for help since googling the snake case name may not give results with the camel case name.I can think of a few options
# pylint:
declaration in each file.pylintrc
file and ask users to copy it to their home (if this can be made to work)__all__ = [...]
in__init__.py
with all the names from the gtsam shared library and/or dummy assignments in__init__.py
likeRot2 = None
but this didn't seem to work for my eitherpylint
from a script or makefile which disables these warnings from the command linepycodestyle
andpyflakes
if a plugin was created, it could be more specific about only ignoring warnings originating from the gtsam module. https://pylint.readthedocs.io/en/stable/how_tos/transform_plugins.html