From a37ae8dbd2ee4b7047d3a7eb64b1fc7bfc762f76 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Wed, 28 Oct 2015 10:07:02 +1100 Subject: [PATCH] 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. --- travis/pr-check-base.py | 2 +- travis/script-in-readme.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/travis/pr-check-base.py b/travis/pr-check-base.py index f3cbab18c..74196cd16 100644 --- a/travis/pr-check-base.py +++ b/travis/pr-check-base.py @@ -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) diff --git a/travis/script-in-readme.py b/travis/script-in-readme.py index 6b38a99f7..b7d0577f3 100644 --- a/travis/script-in-readme.py +++ b/travis/script-in-readme.py @@ -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