Index: clang-tidy/add_new_check.py =================================================================== --- clang-tidy/add_new_check.py +++ clang-tidy/add_new_check.py @@ -204,19 +204,39 @@ with open(filename, 'w') as f: note_added = False header_found = False + next_header_found = False + add_note_here = False for line in lines: if not note_added: match = re.search('Improvements to clang-tidy', line) + match_next = re.search('Improvements to include-fixer', line) + match_checker = re.search('- New :doc:`(.*)', line) + if match_checker: + last_checker = match_checker.group(1) + if last_checker > check_name_dashes: + add_note_here=True + + if match_next: + next_header_found = True + add_note_here = True + if match: header_found = True - elif header_found: + f.write(line) + continue + + if line.startswith('----'): + f.write(line) + continue + + if header_found & add_note_here: if not line.startswith('----'): - f.write(""" -- New :doc:`%s + f.write("""- New :doc:`%s ` check. FIXME: add release notes. + """ % (check_name_dashes, check_name_dashes)) note_added = True