Prezzodaman / pymod

POSTPONED - Python program that plays/renders ProTracker modules using PyAudio (available on PyPI as "pymod-amiga")
https://verycheapwebsite.rf.gd/pymod
GNU General Public License v3.0
11 stars 1 forks source link

Fixed Flake8 linting errors #8

Closed DidierMalenfant closed 4 months ago

DidierMalenfant commented 4 months ago

Mainly whitepsace formatting by replacing tabs with spaces, adding spaces around operator, making sure there are two spaces before comments…

Fixed all test against None to no use binary test but ‘is None’ or ‘is not None’ instead.

Also removed ‘bare’ except and made them at least catch Exception the type (https://stackoverflow.com/questions/54948548/what-is-wrong-with-using-a-bare-except).

I use Flake8 in its default setting apart from the line character count so all these fixes should be pretty standard.

Prezzodaman commented 4 months ago

I'm unsure about this. I'm concerned that this could cause some serious conflict when merging code, since I have different sensibilities (using tabs instead of spaces, no spaces around operators, etc.), and they haven't caused any issues in the past. While I'm sure it's just personal preference, I might not merge these changes unless there's an extremely valid reason to do so.

DidierMalenfant commented 4 months ago

I understand.

I always lint the code I work on in real-time in my text editor and those are industry standard best-practices settings from flake8 so without those, my screen is a sea of yellow warnings for those files :)

Let me know what you decide to do and I'll continue working on my fork in the meantime.

Prezzodaman commented 4 months ago

I appreciate the understanding! I know my sensibilities probably aren't the best, but seeing as I just use a standard text editor (it's what I'm most comfortable with), I haven't messed around with linting before. Of course, I don't mean to be stubborn... maybe I should change the way I write Python code ;)

If it's easier, I could write my code as usual, then after testing it fully, I can go through what I've written so there are no errors when being run through Flake8. I just want to make sure things are easy for everyone, so let me know what works best, and I'll try and do what I can!

DidierMalenfant commented 4 months ago

It's your project, you have to do what you think is best :)

Linting helps me a lot to find silly mistakes and write clean code, it's always turned on while I'm editing.

I personally won't have the time to merge the changes I make back to the non-linted version though. I hope you understand.

I'm forging ahead in my fork (unit tests are in now). If you merge this PR I can provide more PRs for the changes I make, otherwise I'll leave it up to you to cherry pick things you want to use and merge them with the main project repo.

I won't be offended either way. You choose.

Prezzodaman commented 4 months ago

Thanks! Seeing as it's more convenient for everyone, and since you've already made the changes (which I GREATLY appreciate) I will merge this pull request, and write my code in the same formatting as used throughout the program :)