def METHOD_NAME(filePath):
    if filePath in blackListFiles:
        raise InvalidFileError("File is blacklisted: \"" + filePath + "\"")
    fileName = os.path.basename(filePath)
    extension = os.path.splitext(fileName)[-1]
    commentChar = None
    if extension in [".cpp", ".c", ".h", ".hpp", ".cs", ".ice", ".proto", ".mm", ".vs", ".m", ".ps", ".hlsl", ".fx"]:
        commentChar = "//"
    elif extension in [".bash", ".sh", ".py", ".yaml", ".yml", ".ps1", ".pl", ".cmake", ".rb", ".init"] or fileName == "CMakeLists.txt":
        commentChar = "#"
    elif extension in [".bat", ".cmd"]:
        commentChar = "::"
    if commentChar is None:
        raise InvalidFileError("Can't handle extension: \"" + extension + "\"")
    # Get file's creation date
    creationDateStr = cmd(["git", "log", "--diff-filter=A", "--format=%ci", "-1", "--", filePath]).strip()
    if not creationDateStr:
        raise InvalidFileError("File not in git index: \"" + filePath + "\"")
    # We only need the day, month and year
    creationDate = datetime.datetime.fromisoformat(creationDateStr.split()[0])
    copyright = None
    if creationDate.year == datetime.datetime.today().year:
        copyright = str(creationDate.year)
    else:
        copyright = str(creationDate.year) + "-" + str(datetime.datetime.today().year)
    return licenseHeaderTemplate.substitute(commentChar=commentChar, copyright=copyright)