Improve travis checks for branch, script docs

The change to pr-check-base avoids failing builds which should pass
because the GH API is limited.  It'll still work almost all of the time,
but no longer fail builds which previously passed and then pushed more
commits.  Closes #694.
develop
PeridexisErrant 2015-10-28 10:07:02 +11:00
parent 5efea525e0
commit a37ae8dbd2
2 changed files with 6 additions and 4 deletions

@ -21,7 +21,7 @@ except ValueError:
pass
except HTTPError as e:
print('Failed to retrieve PR information from API: %s' % e)
sys.exit(2)
sys.exit(0)
if 'base' not in res or 'ref' not in res['base']:
print('Invalid JSON returned from API')
sys.exit(2)

@ -19,8 +19,10 @@ def check_file(fname):
if l.startswith('=end'):
break
else:
#print(doclines); sys.exit()
print('Error: docs start but not end:', fname)
if doclines:
print('Error: docs start but not end: ' + fname)
else:
print('Error: no documentation in: ' + fname)
return 1
title, underline = doclines[2], doclines[3]
if underline != '=' * len(title):
@ -28,7 +30,7 @@ def check_file(fname):
return 1
start = fname.split('/')[-2]
if start != 'scripts' and not title.startswith(start):
print('Error: title is missing start string:', fname, start, title)
print('Error: title is missing start string: {} {} {}'.format(fname, start, title))
return 1
return 0