You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would also be interested in this.
Since the cell magics can only occur at the first line of a code chunk, I think it should be rather easy to exclude them.
In fact, adding a line to your regex parser that skips a line starting with % should already solve the problem.
In fact, adding a line to your regex parser that skips a line starting with % should already solve the problem.
Unfortunately, this would break:
foo= (
'%s'%'bar'
)
if black can't parse it I don't think we can either
and even if we did put some weird substitution in place, I'm not sure how it could survive a round of formatting
In the meantime, there's my little project nbQA which, like the above PR to black, transform cells using IPython's TransformerManager and ast.parse to preserve/round-trip magics
With
jupytext
one can keep notebooks as Markdown files.Often one uses Jupyter magics (e.g.,
%%time
), when running blacken-docs on the.md
files I get many warnings like:Would it be possible to easily ignore those magics?
The text was updated successfully, but these errors were encountered: