We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yapf: enable
Describe the bug
If you have yapf: enable comments inside an expression, you can cause black to hang:
To Reproduce
with file.py as:
file.py
def test_func(): # yapf: disable if a: return True # yapf: enable elif b: return True return False
$ black file.py
It hangs forever.
Expected behavior
It should not hang.
At the very least it should give an error.
Preferably it should ignore those comments and not break anything.
Environment
Also happens on the https://black.vercel.app/
The text was updated successfully, but these errors were encountered:
# yapf: disable if a: return True # yapf: enable elif b: return False
is the smallest I can reduce it to.
It seems that the yapf: disable is needed as well.
yapf: disable
Sorry, something went wrong.
And version hunting, it seems (for me) to crop up between: black==19.10b0 (good - doesn't hang) and black==20.8b0 (bad - does hang)
black==19.10b0
black==20.8b0
Hopefully that helps narrow it down.
And trying to find the problem w/ git bisect narrows it down to: #1325
git bisect
892eddacd215d685e136686b7f629ade70adca83 is the first bad commit commit 892eddacd215d685e136686b7f629ade70adca83 Author: otstrel <otstrel@gmail.com> Date: Fri May 8 15:37:17 2020 +0300 Fix for "# fmt: on" with decorators (#1325) black.py | 49 ++++++++++++++++++++++++++++++++++++++++--------- tests/data/fmtonoff4.py | 31 +++++++++++++++++++++++++++++++ tests/test_black.py | 8 ++++++++ 3 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 tests/data/fmtonoff4.py
#fmt: on/off
Successfully merging a pull request may close this issue.
Describe the bug
If you have
yapf: enable
comments inside an expression, you can cause black to hang:To Reproduce
with
file.py
as:It hangs forever.
Expected behavior
It should not hang.
At the very least it should give an error.
Preferably it should ignore those comments and not break anything.
Environment
Also happens on the https://black.vercel.app/
The text was updated successfully, but these errors were encountered: