Index: clang-tidy/add_new_check.py =================================================================== --- clang-tidy/add_new_check.py +++ clang-tidy/add_new_check.py @@ -261,6 +261,38 @@ """ % {"check_name_dashes" : check_name_dashes, "underline" : "=" * len(check_name_dashes)}) + +# Adds the new check to the release notes for clang-tidy +def adapt_release_notes(module_path, module, check_name): + check_name_dashes = module + '-' + check_name + filename = os.path.normpath( + os.path.join(module_path, '../../docs/ReleaseNotes.rst')) + print('Updating %s...' % filename) + with open(filename, 'r') as release_notes: + lines = release_notes.readlines() + with open(filename, 'w') as release_notes: + clang_tidy_found = False + clang_tidy_heading_found = False + bullet_found = False + + for line in lines: + if not clang_tidy_found: + if line.startswith("Improvements to ``clang-tidy``"): + clang_tidy_found = True + elif not clang_tidy_heading_found: + if line.startswith('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'): + clang_tidy_heading_found = True + elif not bullet_found: + if line.startswith('- '): + bullet_found = True + release_notes.write('- New ``' + check_name_dashes + '`` check\n') + release_notes.write('\n') + release_notes.write(' FIXME: summarize the check\n') + release_notes.write('\n') + release_notes.write(line) + pass + + def main(): if len(sys.argv) == 2 and sys.argv[1] == '--update-docs': update_checks_list(os.path.dirname(sys.argv[0])) @@ -289,6 +321,7 @@ adapt_module(module_path, module, check_name, check_name_camel) write_test(module_path, module, check_name) write_docs(module_path, module, check_name) + adapt_release_notes(module_path, module, check_name) update_checks_list(clang_tidy_path) print('Done. Now it\'s your turn!')