qomui
qomui copied to clipboard
DIR-variables code style suggestions
I noticed that you set the same global variables at multiple places of the your python scripts (like e.g. ROOTDIR).
I would suggest to put them in seperate file (e.g. config.py) and import them from there.
I would also suggest to make use of QStandardPaths, instead of hardcode them (especially if you want to target different distributions in the future). The config path for example could be obtained with:
from PyQt5 import QtCore
config_path = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.ConfigLocation)
I can open a pull request if you want to.
You're right, that's really ugly. Both have been on my to-do-list for a while. It's about time.
That is good hear :)
Another thing that just occured to me: Do you currently use some kind of linter like flake8? To set one as a standard linter for your project would allow contributers to maintain a consistent coding style.
Frankly, I haven't really used linting a lot. Qomui has started as a total beginner's project and the inconsistencies within the code as I realize reflect that. So there's a lot of things to clean up. I'm really glad for your suggestions. What would be a good/common way to set a standard linter?
Well, as a start you could include this into your Readme:
To test for style errors:
$ flake8
Also, I didn't manage to install a local development setup for qomui. It would be nice to have a deterministic way to install qomui in a virtual environment.
Personally I really like contribution-guides like this one: https://github.com/borgbase/vorta/blob/351b8370a7ebdb853e0864186b40c96c731f275e/CONTRIBUTING.md
Thanks, I'll have a look at that!