Merge "Sort zuul/layout.yaml alphabetical"

This commit is contained in:
Jenkins 2015-10-19 00:25:25 +00:00 committed by Gerrit Code Review
commit 29dc96d915
2 changed files with 4225 additions and 4271 deletions

View File

@ -48,22 +48,20 @@ def normalize(s):
return s.lower().replace("_", "-") return s.lower().replace("_", "-")
def check_sections(): def check_projects_sorted():
"""Check that the projects are in alphabetical order per section.""" """Check that the projects are in alphabetical order per section."""
print("Checking sections for alphabetical order") print("Checking project list for alphabetical order")
print("========================================") print("============================================")
# Note that the file has different sections and we need to sort # Note that the file has different sections and we need to sort
# entries within these sections. # entries within these sections.
errors = False errors = False
# Skip all entries before the first section header # Skip all entries before the project list
firstEntry = True firstEntry = True
last = "" last = ""
for line in open('zuul/layout.yaml', 'r'): for line in open('zuul/layout.yaml', 'r'):
if line.startswith('# Section:'): if line.startswith('projects:'):
last = "" last = ""
section = line[10:].strip()
print("Checking section '%s'" % section)
firstEntry = False firstEntry = False
if line.startswith(' - name: ') and not firstEntry: if line.startswith(' - name: ') and not firstEntry:
current = line[10:].strip() current = line[10:].strip()
@ -92,8 +90,7 @@ def check_formatting():
return errors return errors
def check_all(): def check_all():
errors = False # this can be removed when the following check is re-enabled errors = check_projects_sorted()
# errors = check_sections() # disabling alphabetical order check for mass stackforge rename
errors = check_merge_template() or errors errors = check_merge_template() or errors
errors = check_formatting() or errors errors = check_formatting() or errors

File diff suppressed because it is too large Load Diff