]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Return `NothingChanged` if non-Python cell magic is detected, to avoid tokenize error...
authorDaniel Sparing <dsparing@google.com>
Mon, 29 Nov 2021 23:07:35 +0000 (18:07 -0500)
committerGitHub <noreply@github.com>
Mon, 29 Nov 2021 23:07:35 +0000 (15:07 -0800)
commita066a2bc8b1b7d87b2029f5ebd684582231b0bbc
tree25a3992688a2ee51b98db2f78c92634c68782fe6
parenta18ee4018f855007bf4a23027a8d6478e56a36bf
Return `NothingChanged` if non-Python cell magic is detected, to avoid tokenize error (#2630)

Fixes https://github.com/psf/black/issues/2627 , a non-Python cell magic such as `%%writeline` can legitimately contain "incorrect" indentation, however this causes `tokenize-rt` to return an error. To avoid this, `validate_cell` should early detect cell magics (just like it detects `TransformerManager` transformations).

Test added too, in the shape of a "badly indented" `%%writefile` within `test_non_python_magics`.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Marco Edward Gorelli <marcogorelli@protonmail.com>
CHANGES.md
docs/faq.md
src/black/__init__.py
src/black/handle_ipynb_magics.py
tests/test_ipynb.py