-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Switch to pep-8 #717
Comments
Sounds good to me. Maybe you can leverage a tool to do this conversion |
@tzutalin Pretty sure there is a way to do this automatically, otherwise PyCharm has a semi-automatic mode that works fairly well. Should be a few hours of manual work. Do you have any preference when you would want to do this? Are there any outstanding pull requests that you want to merge beforehand? Merging anything afterwards that has been branched off a pre-pep8-state could be a bit of a pain, since almost every line of code will be touched in the conversion. |
@tzutalin Okay, I'm done with the first step. Do you have some sort of checklist for testing whether everything works? I've run the unit tests but it seems like two failed even before my change. I could play around with the tool for a bit to see if everything seems to work fine, but if you have a more robust way of testing, I'd like to double-check |
We don’t have auto integration tests yet. You need to do manual integrations at the moment. Basically, you can do these manual tests:
|
@tzutalin It looks fine, except for the the CreateML format which seems to have problems saving and loading. I cross-checked with the master branch before my changes and the bug is there as well. I will open a separate issue for this I did all the checks you suggested and my changes work without problems, so I'll open a PR for you to review |
@tzutalin Currently working on stage two by removing more warnings and making the code a bit prettier. I found a few loose ends that could point towards undesired behaviour, I'll mark them as to discuss when I open the second PR after the first one passes. |
Hi Cerno, |
@tzutalin Sure, no problem. I'm pretty much done with the changes to stage 2 (need to do some thorough testing though). I have it on a separate branch and will create a PR once the current PR is merged. Not trying to pressure you or anything, but could you give me some insight on how much time it generally takes you to review and merge a PR? |
Hi |
PR looks good to me. |
The codebase seems to adhere to the camelcase notation generally used in C++, likely to keep in line with Qt's function naming.
I was wondering whether you might be open to switching to the Python-recommended naming scheme defined in the PEP-8 https://www.python.org/dev/peps/pep-0008/
Of course, PEP-8 clearly states in the beginning that it should not be applied blindly, however this has become a somewhat standard in the python world that most code analysis tools support and it makes for a more unified and well-readable code base.
I would offer to make the conversion to PEP-8 for labelImg if you would go along with it, but I understand that this is a huge change that touches almost all code files and will cause pending pull-requests to be affected, so it might not be high (or at all) on your priority list.
I would probably do this in multiple steps, with the first step being to convert all the variable and function names to snake-case, so that each line of code stays exactly where it is, which would make adapting outstanding pull-requests easy without breaking anything. Later, I would make some style changes that actually improve code readability so that all warnings that a tool like lint would report, vanish. This makes future bugs easier to identify and avoid while coding.
Please let me know if you are open to the idea of switching to PEP-8.
The text was updated successfully, but these errors were encountered: