diff options
| author | Alexander Kornienko <alexfh@google.com> | 2017-07-12 13:13:41 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2017-07-12 13:13:41 +0000 |
| commit | c2dcdd99844761fd0414c4ad51f61bd8b4832c53 (patch) | |
| tree | eeb3a360cbfb60be4506250517e0a51ac2255c02 /clang-tools-extra/clang-tidy/add_new_check.py | |
| parent | 1fa729999beb400ccdc5c35f412738a63c656438 (diff) | |
| download | bcm5719-llvm-c2dcdd99844761fd0414c4ad51f61bd8b4832c53.tar.gz bcm5719-llvm-c2dcdd99844761fd0414c4ad51f61bd8b4832c53.zip | |
[clang-tidy] add_new_check.py updates ReleaseNotes.rst now
llvm-svn: 307787
Diffstat (limited to 'clang-tools-extra/clang-tidy/add_new_check.py')
| -rwxr-xr-x | clang-tools-extra/clang-tidy/add_new_check.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py index 7032ad9cf8e..c7d212e22cb 100755 --- a/clang-tools-extra/clang-tidy/add_new_check.py +++ b/clang-tools-extra/clang-tidy/add_new_check.py @@ -189,6 +189,37 @@ def adapt_module(module_path, module, check_name, check_name_camel): f.write(line) +# Adds a release notes entry. +def add_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')) + with open(filename, 'r') as f: + lines = f.readlines() + + print('Updating %s...' % filename) + with open(filename, 'wb') as f: + note_added = False + header_found = False + + for line in lines: + if not note_added: + match = re.search('Improvements to clang-tidy', line) + if match: + header_found = True + elif header_found: + if not line.startswith('----'): + f.write(""" +- New `%s + <http://clang.llvm.org/extra/clang-tidy/checks/%s.html>`_ check + + FIXME: add release notes. +""" % (check_name_dashes, check_name_dashes)) + note_added = True + + f.write(line) + + # Adds a test for the check. def write_test(module_path, module, check_name): check_name_dashes = module + '-' + check_name @@ -300,6 +331,7 @@ documentation files.""" write_header(module_path, module, check_name, check_name_camel) write_implementation(module_path, module, check_name_camel) adapt_module(module_path, module, check_name, check_name_camel) + add_release_notes(module_path, module, check_name) write_test(module_path, module, check_name) write_docs(module_path, module, check_name) update_checks_list(clang_tidy_path) |

