Sort zuul/layout.yaml alphabetical

Sort zuul/layout.yaml project entries in alphabetical
order by "namespace/project".

Reenable check for sorted order of layout.yaml that has been disabled
during mass project rename.

Change-Id: I3749f88edd1984286f9cfc840bfe37722b2f28be
This commit is contained in:
Andreas Jaeger 2015-10-18 19:12:13 +02:00
parent 0888bc8bcd
commit ba7ad70283
2 changed files with 4225 additions and 4271 deletions

View File

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

File diff suppressed because it is too large Load Diff