Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (39 sloc) 2.7 KB
Root.Formatting.Spacing.BlankLine.NewlineAtEOF Parent Index
Sibling aspects BlankLineAfterClass BlankLineAfterDeclaration BlankLineAfterProcedure

NewlineAtEOF

Newline character (usually '\n', aka CR) found at the end of file.

Tastes

Taste Meaning Values
newline_at_EOF If True, enforce a newline at End Of File. True, False

* bold denotes default value

Subaspects

This aspect does not have any sub aspects.

Example

def do_nothing():
    pass

Importance

A text file consists of a series of lines, each of which ends with a newline character (\n). A file that is not empty and does not end with a newline is therefore not a text file.

It's not just bad style, it can lead to unexpected behavior, utilities that are supposed to operate on text files may not cope well with files that don't end with a newline.

How to fix this

NewlineAtEOF issues can be fixed by simply adding a newline at the end of the file.