def longest_word(file_name):
    """
    This function takes a string file_name and returns the longest word in the
    file with which line it appears on. If there is tie for longest word,
    the function return the one that appears first in the file. If the file is
    empty or there are no words in the file, the function should return None.
    """
    with open(file_name) as file:
        lines = file.readlines()
        line_number = -1
        longest_word = ""
        word_length = 0
        for index, line in enumerate(lines):
            index = index + 1
            words = line.split()
            for word in words:
                if len(word) > word_length:
                    longest_word = word
                    word_length = len(word)
                    line_number = index
    if longest_word == "":
        return None
    else:
        return str(line_number) + ": " + longest_word