report(f"{file_name} has line {i+1} which does not seem to specify a key, such as 'name:' or 'link:'. Please prepend the line with key or remove the line entirely.")
continue
ifkey!=key.strip():
report(f"{file_name} contains a space between the key '{key}' and the colon, please remove it.")
key=key.strip()
ifkey!=key.lower():
report(f"{file_name} contains a non-lowercase key {key} on line {i+1}. Please convert it to lowercase.")
key=key.lower()
ifnotvalue.startswith(""):
report(f"A space is missing after '{key}:' in {file_name} on line {i+1}. Please add it.")
value=value[1:]
ifvalue!=value.strip():
report(f"{file_name} contains too many spaces after '{key}:' on line {i+1}, please keep exactly one space.")
value=value.strip()
ifvalue=="":
report(f"{file_name} contains an empty '{key}:' on line {i+1}, please fix this.")
report(f"{file_name} contains an asterisk on line {i+1}. The signatures are not rendered as Markdown, so formatting won't work. Please remove the asterisk.")
report(f"{file_name} contains a colon followed by a space (': ') in the name on line {i+1}. This will cause the parser to parse the file incorrectly. Please wrap the name in double quotes.")
elifvalue.replace("","").startswith("name"):
report(f"The name in {file_name} starts with 'name' on line {i+1}. This may indicate a placeholder.")
report(f"{file_name} contains unexpected whitespace on line {i+1}. Please remove whitespace from the link.")
ifvalue.startswith("mailto:"):
if"@"notinvalue:
report(f"{file_name} uses mailto: on line {i+1}, but the part that follows doesn't look like e-mail and does not contain '@' character. Please fix the address.")
elif"://"invalue:
protocol=value.split("://")[0]
ifprotocolnotin("http","https"):
report(f"{file_name} uses a strange protocol '{protocol}' on line {i+1}. Please use https:// or http://.")
elif"@"invalueandnotvalue.startswith("mailto:"):
report(f"{file_name} seems to use a e-mail in a link on line {i+1}. Please add 'mailto:' before the e-mail.")
elifvalue=="/#":
pass
else:
report(f"{file_name} doesn't specify any link protocol on line {i+1}. Please add https:// or http://.")
else:
report(f"{file_name} contains an unrecognized key {key} on line {i+1}. Only 'name:' and 'link:' are supported.")
if"name"notinexisting_keys:
report(f"{file_name} doesn't contain a name. Please specify your name or your alias.")
if"link"notinexisting_keys:
report(f"{file_name} doesn't contain a link. Please specify a link to your online profile, e.g. on GitHub. If you really don't have a link, use /#")