Check indenting of jenkins/jobs/projects.yaml

I just noticed when reviewing the file that a couple of indents were
off.  This isn't major, but we can catch that pretty easily with the
existing jenkins-projects-checks.py.

Change-Id: I92ffda01a2e766954c18fe795862186863f8182f
This commit is contained in:
Ian Wienand 2015-07-17 12:10:39 +10:00
parent 219db9c669
commit b472603903
2 changed files with 40 additions and 31 deletions

View File

@ -23,12 +23,14 @@ def normalize(s):
def check_sections():
"""Check that the projects are in alphabetical order per section."""
"""Check that the projects are in alphabetical order per section
and that indenting looks correct"""
# Note that the file has different sections and we need to check
# entries within these sections only
errors = False
last = ""
count = 1
for line in open('jenkins/jobs/projects.yaml', 'r'):
if line.startswith('# Section:'):
last = ""
@ -42,6 +44,13 @@ def check_sections():
{"last": last, "current": current})
errors = True
last = current
if (len(line) - len(line.lstrip(' '))) % 2 != 0:
print("Line %(count)s not indented by multiple of 2:\n\t%(line)s" %
{"count": count, "line": line})
errors = True
count = count+1
return errors