Skip to content
Unverified Commit a066a2bc authored by Daniel Sparing's avatar Daniel Sparing Committed by GitHub
Browse files

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: default avatarJelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: default avatarMarco Edward Gorelli <marcogorelli@protonmail.com>
parent a18ee401
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment