PyCharm 5 complains of a missing newline at the end of the file:
How do I tell PyCharm to add the newline (if missing) automatically whenever I save a file?
This can be enabled in the Editor > General
settings:
From the File menu under ☰, pick Settings...
, then select Editor > General
. Under the On Save
section in the right-hand pane, check the Ensure every saved file ends with a line break
checkbox.
For older versions of PyCharm:
From the File pick Settings
, then select Editor > General
. Under the Other
section in the right-hand pane, check the Ensure an empty line at the end of a file on Save
checkbox.