-
Notifications
You must be signed in to change notification settings - Fork 386
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
When notebook ends in a code cell, generated python code has two empty lines at the end instead of one #682
Comments
Hi @stanleygu , thanks for paying attention to this. This is a point that is not explicitly stated in the documentation, but indeed, it is also my expectation that the files generated by Jupytext are PEP8 compliant when the input cells are. I gave a try to your report and I have not been able (yet) to reproduce your issue. May I ask you, therefore, to have a look at the metatada for that cell? Do you have, for some reason, a metadata named |
I have added a test, in which I find only one empty line at the end of scripts:
As I cannot reproduce the issue I am going to close it. Nevertheless, if you have another example I am interested - please submit it in the form of a test as seen above. Thanks |
Steps to reproduce:
jupytext --to py:percent notebookWithCodeCell.ipynb
.I would expect there to just be one new line.
The main motivation for this is that black reformats the code to just have one new line, and it would be nice if the generated code was stable when using black.
An alternative is to use
--pipe black
in the conversion, but I use the JupyterLab paired notebook, which runs the sync automatically without the pipe.The text was updated successfully, but these errors were encountered: