Skip to content

Commit 49aa0eb

Browse files
committed
treewide: fixes to make pylint happier
Right now the CI fails and that makes me and my PRs unhappy. Signed-off-by: Paul Spooren <mail@aparcar.org>
1 parent 9e0562e commit 49aa0eb

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

labgrid/driver/mqtt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def _on_message(self, client, userdata, msg):
4343
status = True
4444
elif msg.payload == b'OFF':
4545
status = False
46+
else:
47+
raise ValueError(f"Unknown status: {msg.payload}. Must be 'ON' or 'OFF'")
4648
self._status = status
4749

4850
def _on_connect(self, client, userdata, flags, reason_code, properties):

labgrid/remote/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,9 @@ def tmc_channel(self):
12121212
data = drv.get_channel_info(channel)
12131213
elif action == 'values':
12141214
data = drv.get_channel_values(channel)
1215+
else:
1216+
raise ValueError(f"unknown action {action}")
1217+
12151218
for k, v in sorted(data.items()):
12161219
print(f"{k:<16s} {str(v):<10s}")
12171220

@@ -1323,6 +1326,9 @@ async def export(self, place, target):
13231326
data = "\n".join(lines) + "\n"
13241327
elif self.args.format is ExportFormat.JSON:
13251328
data = json.dumps(exported)
1329+
else:
1330+
raise NotImplementedError(f"unsupported format {self.args.format}")
1331+
13261332
if self.args.filename == "-":
13271333
sys.stdout.write(data)
13281334
else:

labgrid/util/yaml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def resolve_templates(data, mapping):
8484
items = enumerate(data)
8585
elif isinstance(data, dict):
8686
items = data.items()
87+
else:
88+
raise TypeError(f"Expected list or dict, got {type(data)}")
89+
8790
for k, val in items:
8891
if isinstance(val, Template):
8992
try:

0 commit comments

Comments
 (0)