[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
carlosgalvezp abandoned this revision. carlosgalvezp added a comment. Merged into https://reviews.llvm.org/D141770 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/rename_check.py:311-314 + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) carlosgalvezp wrote: > Eugene.Zelenko wrote: > > njames93 wrote: > > > I'd argue the change to update all checks should go in at the same time. > > `Clang-tidy` or just `all checks`, since script is about Clang-tidy. > Patch for that here, would you like me to merge them? > > https://reviews.llvm.org/D141770 Let's do everything in the same patch, I'll abandon this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:109-110 +- Use C++17 nested namespaces in `add_new_check.py` and `rename_check.py`. + New checks njames93 wrote: > Such a trivial change like this probably doesn't need to go in the release > notes, @Eugene.Zelenko thoughts? Probably should not, since entire code base was moved to C++17. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/rename_check.py:311 filename = fileRename(filename, old_module_path, new_module_path) + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. njames93 wrote: > I'd argue the change to update all checks should go in at the same time. `Clang-tidy` or just `all checks`, since script is about Clang-tidy. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/rename_check.py:311-314 + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) njames93 wrote: > I'd argue the change to update all checks should go in at the same time. Patch for that here, would you like me to merge them? https://reviews.llvm.org/D141770 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
njames93 accepted this revision. njames93 added a comment. LGTM, just a couple points Comment at: clang-tools-extra/clang-tidy/rename_check.py:311-314 + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) I'd argue the change to update all checks should go in at the same time. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:109-110 +- Use C++17 nested namespaces in `add_new_check.py` and `rename_check.py`. + New checks Such a trivial change like this probably doesn't need to go in the release notes, @Eugene.Zelenko thoughts? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
Eugene.Zelenko accepted this revision. Eugene.Zelenko added a comment. This revision is now accepted and ready to land. But will be good idea if other eyes will look too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
carlosgalvezp updated this revision to Diff 489271. carlosgalvezp added a comment. Update release notes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141769/new/ https://reviews.llvm.org/D141769 Files: clang-tools-extra/clang-tidy/add_new_check.py clang-tools-extra/clang-tidy/rename_check.py clang-tools-extra/docs/ReleaseNotes.rst Index: clang-tools-extra/docs/ReleaseNotes.rst === --- clang-tools-extra/docs/ReleaseNotes.rst +++ clang-tools-extra/docs/ReleaseNotes.rst @@ -106,6 +106,8 @@ which is no longer in use. The option will be fully removed in :program:`clang-tidy` version 18. +- Use C++17 nested namespaces in `add_new_check.py` and `rename_check.py`. + New checks ^^ Index: clang-tools-extra/clang-tidy/rename_check.py === --- clang-tools-extra/clang-tidy/rename_check.py +++ clang-tools-extra/clang-tidy/rename_check.py @@ -308,8 +308,13 @@ for filename in check_implementation_files: # Move check implementation to the directory of the new module. filename = fileRename(filename, old_module_path, new_module_path) + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) + replaceInFileRegex(filename, + 'namespace clang::tidy::' + old_module + '[^ \n]*', + 'namespace clang::tidy::' + new_namespace) if (args.old_check_name == args.new_check_name): return Index: clang-tools-extra/clang-tidy/add_new_check.py === --- clang-tools-extra/clang-tidy/add_new_check.py +++ clang-tools-extra/clang-tidy/add_new_check.py @@ -77,9 +77,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { /// FIXME: Write a short description. /// @@ -93,9 +91,7 @@ void check(const ast_matchers::MatchFinder::MatchResult ) override; }; -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s #endif // %(header_guard)s """ % {'header_guard': header_guard, @@ -129,9 +125,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { void %(check_name)s::registerMatchers(MatchFinder *Finder) { // FIXME: Add matchers. @@ -149,9 +143,7 @@ << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_"); } -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s """ % {'check_name': check_name_camel, 'module': module, 'namespace': namespace}) Index: clang-tools-extra/docs/ReleaseNotes.rst === --- clang-tools-extra/docs/ReleaseNotes.rst +++ clang-tools-extra/docs/ReleaseNotes.rst @@ -106,6 +106,8 @@ which is no longer in use. The option will be fully removed in :program:`clang-tidy` version 18. +- Use C++17 nested namespaces in `add_new_check.py` and `rename_check.py`. + New checks ^^ Index: clang-tools-extra/clang-tidy/rename_check.py === --- clang-tools-extra/clang-tidy/rename_check.py +++ clang-tools-extra/clang-tidy/rename_check.py @@ -308,8 +308,13 @@ for filename in check_implementation_files: # Move check implementation to the directory of the new module. filename = fileRename(filename, old_module_path, new_module_path) + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) + replaceInFileRegex(filename, + 'namespace clang::tidy::' + old_module + '[^ \n]*', + 'namespace clang::tidy::' + new_namespace) if (args.old_check_name == args.new_check_name): return Index: clang-tools-extra/clang-tidy/add_new_check.py === --- clang-tools-extra/clang-tidy/add_new_check.py +++ clang-tools-extra/clang-tidy/add_new_check.py @@ -77,9 +77,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { /// FIXME: Write a short description. /// @@ -93,9 +91,7 @@ void check(const ast_matchers::MatchFinder::MatchResult ) override; }; -} // namespace %(namespace)s -} // namespace tidy -} // namespace
[PATCH] D141769: [clang-tidy][NFC] Use C++17 nested namespaces in add_new_check.py and rename_check.py
carlosgalvezp created this revision. Herald added a subscriber: xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D141769 Files: clang-tools-extra/clang-tidy/add_new_check.py clang-tools-extra/clang-tidy/rename_check.py Index: clang-tools-extra/clang-tidy/rename_check.py === --- clang-tools-extra/clang-tidy/rename_check.py +++ clang-tools-extra/clang-tidy/rename_check.py @@ -308,8 +308,13 @@ for filename in check_implementation_files: # Move check implementation to the directory of the new module. filename = fileRename(filename, old_module_path, new_module_path) + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) + replaceInFileRegex(filename, + 'namespace clang::tidy::' + old_module + '[^ \n]*', + 'namespace clang::tidy::' + new_namespace) if (args.old_check_name == args.new_check_name): return Index: clang-tools-extra/clang-tidy/add_new_check.py === --- clang-tools-extra/clang-tidy/add_new_check.py +++ clang-tools-extra/clang-tidy/add_new_check.py @@ -77,9 +77,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { /// FIXME: Write a short description. /// @@ -93,9 +91,7 @@ void check(const ast_matchers::MatchFinder::MatchResult ) override; }; -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s #endif // %(header_guard)s """ % {'header_guard': header_guard, @@ -129,9 +125,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { void %(check_name)s::registerMatchers(MatchFinder *Finder) { // FIXME: Add matchers. @@ -149,9 +143,7 @@ << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_"); } -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s """ % {'check_name': check_name_camel, 'module': module, 'namespace': namespace}) Index: clang-tools-extra/clang-tidy/rename_check.py === --- clang-tools-extra/clang-tidy/rename_check.py +++ clang-tools-extra/clang-tidy/rename_check.py @@ -308,8 +308,13 @@ for filename in check_implementation_files: # Move check implementation to the directory of the new module. filename = fileRename(filename, old_module_path, new_module_path) + # TODO: remove below replacement when all clang-tidy checks have been + # updated with C++17 nested namespaces. replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', 'namespace ' + new_namespace) + replaceInFileRegex(filename, + 'namespace clang::tidy::' + old_module + '[^ \n]*', + 'namespace clang::tidy::' + new_namespace) if (args.old_check_name == args.new_check_name): return Index: clang-tools-extra/clang-tidy/add_new_check.py === --- clang-tools-extra/clang-tidy/add_new_check.py +++ clang-tools-extra/clang-tidy/add_new_check.py @@ -77,9 +77,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { /// FIXME: Write a short description. /// @@ -93,9 +91,7 @@ void check(const ast_matchers::MatchFinder::MatchResult ) override; }; -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s #endif // %(header_guard)s """ % {'header_guard': header_guard, @@ -129,9 +125,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { void %(check_name)s::registerMatchers(MatchFinder *Finder) { // FIXME: Add matchers. @@ -149,9 +143,7 @@ << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_"); } -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s """ % {'check_name': check_name_camel, 'module': module, 'namespace': namespace}) ___ cfe-commits mailing list cfe-commits@lists.llvm.org