missing-final-newline / C0304#
Message emitted:
Final newline missing
Description:
Used when the last line in a file is missing a newline.
Problematic code:
# using LF
eat("apple", "candy") # \n
print(123) # EOF
# using CRLF
eat("apple", "candy") # \r\n
print(123) # EOF
# [missing-final-newline]
Correct code:
# using LF
eat("apple", "candy") # \n
print(123) # \nEOF
# using CRLF
eat("apple", "candy") # \r\n
print(123) # \r\nEOF
Additional details:
- The POSIX standard defines a line as:
"A sequence of zero or more non- <newline> characters plus a terminating <newline> character."
Related links:
Created by the format checker.