C0rn3j / sc-controller

User-mode driver and GTK3 based GUI for Steam Controller
GNU General Public License v2.0
24 stars 2 forks source link

Fix return code when subprocess fails #33

Closed git-developer closed 1 month ago

git-developer commented 1 month ago

This PR fixes the following problem: when a subprocess fails, the application returns with exit code 0.

This behaviour complicates AppImage tests because output must be parsed to check if a test failed.

A GitHub Action run is available

C0rn3j commented 1 month ago

For the things you're adding and reworking in the Python part, could you please add types for both the function variables and returns?

I've edited the PR to have docstrings and at least the obvious str type as I don't have my usual editor atm.

git-developer commented 1 month ago

Tried my best, but it's not my main business, please check.

C0rn3j commented 1 month ago

Thanks!
The run_osd_tool just straight out exits and doesn't return anything.
I added some more since I already had it open.

I highly recommend you setup your editor to actually makes use of the type hints if you haven't already, it's fairly convoluted to navigate the codebase without them.

Not that a lot of it is covered by them yet...

git-developer commented 1 month ago

Thanks for your review and the code style improvements!