message: Ensure consistency in name, description, group test/benchmark header.
diff: @@ -189,27 +189,27 @@ def get_formatted_text(f, full_path, directory, ext):
  new_path_line = '# name: ' + full_path + '\n'
  new_group_line = '# group: [' + group_name + ']' + '\n'
  found_diff = False
  - for i in range(0, len(lines)):
  - line = lines[i]
  - if line.startswith('# name: ') or line.startswith('#name: '):
  - if found_name:
  - print("Error formatting file " + full_path + ", multiple lines starting with # name found")
  - exit(1)
  - found_name = True
  - if lines[i] != new_path_line:
  - lines[i] = new_path_line
  - if line.startswith('# group: ') or line.startswith('#group: '):
  - if found_group:
  - print("Error formatting file " + full_path + ", multiple lines starting with # group found")
  + # Find description.
  + found_description = False
  + for line in lines:
  + if line.lower().startswith('# description:') or line.lower().startswith('#description:'):
  + if found_description:
  + print("Error formatting file " + full_path + ", multiple lines starting with # description found")
  exit(1)
  - found_group = True
  - if lines[i] != new_group_line:
  - lines[i] = new_group_line
  - if not found_group:
  - lines = [new_group_line] + lines
  - if not found_name:
  - lines = [new_path_line] + lines
  - return ''.join(lines)
  + found_description = True
  + new_description_line = '# description: ' + line.split(':', 1)[1].strip() + '\n'
  + # Filter old meta.
  + meta = ['#name:', '# name:', '#description:', '# description:', '#group:', '# group:']
  + lines = [line for line in lines if not any(line.lower().startswith(m) for m in meta)]
  + # Clean up empty leading lines.
  + while lines and not lines[0].strip():
  + lines.pop(0)
  + # Ensure header is prepended.
  + header = [new_path_line]
  + if found_description: header.append(new_description_line)
  + header.append(new_group_line)
  + header.append('\n')
  + return ''.join(header + lines)
  proc_command = format_commands[ext].split(' ') + [full_path]
  proc = subprocess.Popen(proc_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  new_text = proc.stdout.read().decode('utf8')
  