def checkFileContents(file_path, checker):
    error_messages = []
    if file_path.endswith('version_history.rst'):
        checkCurrentReleaseNotes(file_path, error_messages)
    for (line_number, line) in enumerate(readLines(file_path)):

        def reportError(message):
            error_messages.append(('%s:%d: %s' % (file_path, (line_number + 1), message)))
        checker(line, file_path, reportError)
    return error_messages
def checkFileContents(file_path, checker):
    error_messages = []
    if file_path.endswith('version_history.rst'):
        checkCurrentReleaseNotes(file_path, error_messages)
    for (line_number, line) in enumerate(readLines(file_path)):

        def reportError(message):
            error_messages.append(('%s:%d: %s' % (file_path, (line_number + 1), message)))
        checker(line, file_path, reportError)
    return error_messages