Check for newlines in project descriptions

As we found out with I88751ed6df7d5f9dad735171e19f82dea745b4da and the
resulting downtime, cgit does not like multi-line description values.
The cgit(5) man page is conspicuously quiet on quoting or multi-line
values; let's just ensure we don't do this again.  This does detect
the newlines in the original change.

Change-Id: I87bcff409d4632c70bff5e4606b4572c38c74e59
This commit is contained in:
Ian Wienand 2017-06-26 11:16:20 +10:00
parent a53c7ba6cd
commit 3647a2f1cb

View File

@ -121,6 +121,12 @@ def main():
(('astor', 'Astor', 'astra', 'Astra', 'astara'), 'Astara')
)
if description:
# newlines here mess up cgit "repo.desc
if '\n' in description:
found_errors += 1
print("ERROR: Descriptions should not contain newlines:")
print(' "%s"' % description)
for words, should_be in badwords:
for word in words:
# look for the bad word hanging out on it's own. Only