def CheckForNewlineAtEOF(filename, lines, error):
 if ((len(lines) < 3) or lines[(-2)]):
  error(filename, (len(lines) - 2), 'whitespace/ending_newline', 5, 'Could not find a newline character at the end of the file.')

def CheckForNewlineAtEOF ( filename , lines , error ) : if ( ( len ( lines ) < 3 ) or lines [ ( - 2 ) ] ) : error ( filename , ( len ( lines ) - 2 ) , 'whitespace/ending_newline' , 5 , 'Could not find a newline character at the end of the file.' )
logs an error if there is no newline char at the end of the file .