pylint shows an error when setting an attribute to a class with setattr
we use .add_file on hrt.Folder which dynamically sets attributes. Resulting in lots of linting errors.
This solution does not work as it introduces other errors. When accessing an unknown attribute it should still raise an error.
def __getattr__(self, name):
"""Ignore pylint errors that attributs set with setattr are
__getattr__ will only get called for undefined attributes.
Idea from:
https://stackoverflow.com/questions/35990313/avoid-pylint-warning-e1101-instance-of-has-no-member-for-class-with-dyn
FIXME: disabled because it breaks code hints (ctrl+space)
"""
warnings.warn(f"No member {name} contained in {self.__class__.__name__}.")
return ""
pylint shows an error when setting an attribute to a class with![image](https://github.com/threedi/hhnk-threedi-plugin/assets/41104904/c3ea8bc4-a9a6-4784-a045-b9a2484e576d)
setattr
we use .add_file on hrt.Folder which dynamically sets attributes. Resulting in lots of linting errors.
This solution does not work as it introduces other errors. When accessing an unknown attribute it should still raise an error.