kenkoooo / jupyter-autopep8

PEP8 formatter for Jupyter Notebook
MIT License
66 stars 6 forks source link

Add option to configure aggressiveness of autopep8 #9

Closed EWouters closed 6 years ago

EWouters commented 6 years ago

Hey, I see you had the same idea as me and used code_prettify's library to make a cell formatting extension. Nice work!

It might be a good idea to make the aggressiveness of autopep8 configurable from the options of jupyter-autopep8 using the syntax below on this line. The cfg['aggressive'] should loaded from the config similar to which keyboard shortcut is used.

            var code_input = 'autopep8.fix_code(' + text + ', options={'aggressive': cfg['aggressive']})';

If I'll get around to it I might make a pull request for this. It might be nice to support all of the autopep8 options from the options of jupyter-autopep8.

edit: seems I can't fork this repo because I already forked code_prettify. edit2: I just edited the code in the browser and sent you a pull request (#10) that includes the aggressive option. More of autopep8's functions can be exposed to the user in a similar way.