ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.22k stars 806 forks source link

Code Prettify doesn't work when combined with pycodestyle_magic #1512

Open PavloFesenko opened 4 years ago

PavloFesenko commented 4 years ago

In the Jupyter Notebook when I activate %pycodestyle_on from the extension pycodestyle_magic, applying Code Prettify to the notebook cells results in a browser pop-up message SyntaxError: Unexpected token : in JSON at position 1. It doesn't give this error for a simple code like a=1 but for something slightly complicated like import of two modules, it does (see the example below). I was wondering if the extension pycodestyle_magic does something fishy or is it a bug within Code Prettify? 🤔

Example

The first cell loads pycodestyle_magic and activates style checking for all cells.

%load_ext pycodestyle_magic
%pycodestyle_on

Code Prettify works for this cell.

a=1

But gives an error for this one.

import pandas as    pd
import numpy as np