Open-MSS / MSS

A QT application, a OGC web map server, a collaboration server to plan atmospheric research flights.
https://open-mss.github.io
Apache License 2.0
56 stars 68 forks source link

should flake8 cry on unused variables? #2475

Open ReimarBauer opened 3 weeks ago

ReimarBauer commented 3 weeks ago

Just seen https://github.com/Open-MSS/MSS/blob/stable/mslib/msui/mscolab.py#L1965C57-L1966C1

name, file_ext = fs.path.splitext(file_name)

is defined but not used.

I am not sure about if our test in the past had seen that.

So: yes

joernu76 commented 3 weeks ago

This warning is one of the actually useful ones as it hints early at typos. In this case one should assign the unused return value to a "_" variable to indicate the intent to not use it to the reader and the tool, e.g.

name, _ = fs.path.splitext(file_name)
ReimarBauer commented 3 weeks ago

also name is not used. A leftover commented is # _function = self.ui.import_plugins[file_ext[1:]] In that xml PR I removed it too, the IDE showed it.

joernu76 commented 3 weeks ago

So the whole line is superfluous as it doesn't do anything? Seems like something that should be flagged?