ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.76k stars 725 forks source link

Shebang cleanup #333

Closed musicinmybrain closed 9 months ago

musicinmybrain commented 9 months ago

This PR makes the use of shebang lines (#!) more consistent and logical.


Remove shebangs from non-executable, non-script files

These files have no “main routines” or interesting side effects and their filesystem permissions do not include the executable bit.

Remove shebangs and execute permission from non-script executables

These files’ filesystem permissions included the executable bit and they had shebang lines, but they have no “main routines” or interesting side effects.

Ensure all scripts with shebangs are executable

Otherwise, there’s no reason to have the shebang.

Fix the shebang in qdarkstyle/example/main.py

Use a shebang based on an absolute path (/usr/bin/env python or (/usr/bin/env python3); #!python is not supposed to work.

Standardize on explicit “python3” in shebangs

Of /usr/bin/env python and /usr/bin/env python3, the latter is recommended. Either way, it’s nice to be consistent.


There is still some inconsistency after this PR. For example, qdarkstyle/utils/__main__.py has a “main routine” but no shebang or executable bit (but people can still run python3 -m qdarkstyle.utils), while qdarkstyle/__main__.py has a shebang and executable permission (and can also be run with python3 -m qdarkstyle).

ccordoba12 commented 9 months ago

@dpizetta, what do you think?

dpizetta commented 9 months ago

@musicinmybrain @ccordoba12 Seems great! Thanks for this revision.

musicinmybrain commented 9 months ago

@musicinmybrain @ccordoba12 Seems great! Thanks for this revision.

You’re welcome. Thank you for reviewing it.

ccordoba12 commented 9 months ago

Ok, merging then.