Skip to content
New issue

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

Skip jupyter magic lines #5

Closed
jason-neal opened this issue Mar 22, 2019 · 1 comment
Closed

Skip jupyter magic lines #5

jason-neal opened this issue Mar 22, 2019 · 1 comment

Comments

@jason-neal
Copy link

I have a cell that has jupyter magic in it.

%%time
# Stuff to time
a = 1

Currently black fails it is not valid python.

black extension
 Error: InvalidInput
Cannot parse: 1:0: %%time

I can get around this by temporarily commenting out the line when running black but would it be possible to just skip these magic lines?

@MarvinT
Copy link

MarvinT commented Mar 27, 2019

Here's an alternative solution that solves this issue:
https://gist.github.com/MarvinT/a072aa992e977496974aaf492287b08c
and
https://marvint.github.io/Black-Jupyter/

drillan added a commit that referenced this issue Jun 22, 2019
@drillan drillan closed this as completed Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants