peterjc / flake8-black

flake8 plugin to run black for checking Python coding style
MIT License
166 stars 10 forks source link

Test cases where black fails #1

Closed peterjc closed 5 years ago

peterjc commented 5 years ago

Need to construct some pathological examples and explore why flake8-black seems to be silent on them. e.g. syntax error from unresolved git merge.

In practise this has not a usability problem, since flake8 complains about the syntax error(s) anyway.

peterjc commented 5 years ago

I had one problem this morning where because of the plugin flake8 crashed via the flake8 git pre-commit hook. (I think) my code to identify the line/col where black's output first differed had a TypeError exception, but sadly I was in a hurry and focussed on the immediate commit, so just fixed the code by running black directly. In hindsight I should have saved that as a the basis of a test case for the plugin - or at least noted down the full traceback.

peterjc commented 5 years ago

Seems with a SyntaxError the plugin does not get invoked, so you should not expect a BLK specific error code, see new test case 4f1602b20a221640182b8e837f23d06a690e2b41

Documentation updated and releasing this as v0.0.2 (no functional changes).

If I do manage to find a crashing example (like I thought I did on 16 Jan), I will open a new issue on that.

peterjc commented 5 years ago

The elusive TypeError mentioned above is fixed by #2, this project's first external contribution ❤️