labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
332 stars 174 forks source link

linter warnings since pylint 3.2.0 #1406

Closed Bastian-Krause closed 4 months ago

Bastian-Krause commented 5 months ago

Since pylint version 3.2.0 was released, our CI fails with these errors in the linting step (warnings emitted on current master 9e0562e1):

***** Module labgrid.util.yaml labgrid/util/yaml.py:87:18: E0606: Possibly using variable 'items' before assignment (possibly-used-before-assignment)

We should probably raise a TypeError in an else clause.

***** Module labgrid.util.dict labgrid/util/dict.py:39:33: E1133: Non-iterable value attr.fields(cls) is used in an iterating context (not-an-iterable)

Seems to be related to https://github.com/pylint-dev/pylint/issues/9626 (attr's pyi). Should be fixed in the next pylint release.

***** Module labgrid.util.agents.network_interface labgrid/util/agents/network_interface.py:98:23: E0606: Possibly using variable 'nm' before assignment (possibly-used-before-assignment)

Probably caused by..

https://github.com/labgrid-project/labgrid/blob/9e0562e1c8d6842c850c239d64896b88c3bf3bd1/labgrid/util/agents/network_interface.py#L291-L295

@jluebbe How should we fix this?

***** Module labgrid.remote.common labgrid/remote/common.py:178:24: E1135: Value 'fields' doesn't support membership test (unsupported-membership-test)

Might also be related to https://github.com/pylint-dev/pylint/issues/9626 ?

***** Module labgrid.remote.client labgrid/remote/client.py:1215:27: E0606: Possibly using variable 'data' before assignment (possibly-used-before-assignment)

I guess we should add an else clause raising an exception here as well?

labgrid/remote/client.py:1327:29: E0606: Possibly using variable 'data' before assignment (possibly-used-before-assignment)

Same here.

***** Module labgrid.driver.mqtt labgrid/driver/mqtt.py:46:23: E0606: Possibly using variable 'status' before assignment (possibly-used-before-assignment)

Same here.

aparcar commented 4 months ago

I tried to fix the simple stuff over here https://github.com/labgrid-project/labgrid/pull/1423