hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
313 stars 61 forks source link

Pylint: false positives on member existence for internal classes #1871

Open reidpr opened 6 months ago

reidpr commented 6 months ago

Split from #1860. Pylint:

We get E1101 quite a lot, e.g.:

https://github.com/hpc/charliecloud/blob/d67937332094a7d8de8e9bd2e112d30d117c50c0/lib/build_cache.py#L360-L362

https://github.com/hpc/charliecloud/blob/d67937332094a7d8de8e9bd2e112d30d117c50c0/lib/build.py#L553

In all these cases, the member does exist but it’s set in a strange way. This lint error is very powerful, so I want to make it useful. This issue is to eliminate the false positives so we can enable the message.

Similarly for W0201:

https://github.com/hpc/charliecloud/blob/d67937332094a7d8de8e9bd2e112d30d117c50c0/lib/build_cache.py#L576-L577

This warning basically says that there is no list of attributes that can be consulted, expecting that in __init__(). For this particular class there is a nice comment explaining all the attributes, but some of them are also set to None in __init__(). Probably should fix all these warnings.