Add final newline check for requirements

Ensure that every line has a newline; particularly the last one.

Change-Id: I8cfa194461946fb78dc9ea0aa51cf6158d5bb81c
This commit is contained in:
James E. Blair 2013-08-16 13:43:59 -07:00
parent 9f06bccfb8
commit 9d2d2455a8

View File

@ -43,6 +43,9 @@ class RequirementsList(object):
if not os.path.exists(fn):
return
for line in open(fn):
if '\n' not in line:
raise Exception("Requirements file %s does not "
"end with a newline." % fn)
if '#' in line:
line = line[:line.find('#')]
line = line.strip()