Closed sapphire-janrain closed 5 years ago
Excellent - You’ve found what looks like the exception I had last month, but regrettably didn’t keep the trace back or test case for:
https://github.com/peterjc/flake8-black/issues/1#issuecomment-454738949
Do you still have an example triggering this error for turning into a minimal test case?
Update: Fixed typo; as noted below I could reproduce this error
Sorry, reviewing this on a phone - the fix looks right and I think trailing blank lines at the end of a file should trigger it. I’ll try making a small test case and merge your fix when so have time in front of a computer, hopefully this afternoon. Thank you!
Update: Missing final new line character triggers this, plus flake8 W292 no newline at end of file
as well.
Also, since I've not written down any policy on contributing yet, would you be happy to be thanked by name and/or GitHub username in the release notes (currently in the README file) and/or a new contributor listing?
I managed to look at this before lunch - how's this update to the pull request which adds a test case, bumps the version ready to release this afternoon, and thanks you in the release history?
Oh, thank you!
It may have been blank lines at the end of the file in my case, as I did have one at some point, but I'm not too sure. It would work when I did the default line length but fail when I changed the max line length to 100. Since this fixed it and it seemed simple enough I didn't care too much to investigate why that mattered, sorry.
Edit: I already cleaned up the original code after getting the report to work, so I'm not sure I could reproduce it, either.
Merged, v0.0.3 should be out shortly - thank you!
Was having this error occasionally while running flake8 over my code:
Just a quick fix for it.