Improve check-style.py
I stumbled upon these issues while rebasing and fixing @jadahl's work for Add VR support under Wayland (#1743):
- The script did not wait for the amend command to complete, which made it unusable in a multi-step rebase. Fixed this by using
subprocess.run()
instead ofPopen()
. - New files were not checked and re-formatted. Fixed this by not turning off formatting when the chunk starts at line 1.
There are some other minor tweaks to improve the readability of the Python code.