[PATCH] Refactor: Move readability checks to namespace clang::tidy::readability

Richard legalize at xmission.com
Mon Mar 2 01:32:47 PST 2015


Hi alexfh,

clang-tidy checks are organized into modules. This refactoring moves the readability module checks into the namespace `clang::tidy::readability`

http://reviews.llvm.org/D7997

Files:
  clang-tidy/readability/ElseAfterReturnCheck.cpp
  clang-tidy/readability/ElseAfterReturnCheck.h
  clang-tidy/readability/ShrinkToFitCheck.cpp
  clang-tidy/readability/ShrinkToFitCheck.h

Index: clang-tidy/readability/ElseAfterReturnCheck.cpp
===================================================================
--- clang-tidy/readability/ElseAfterReturnCheck.cpp
+++ clang-tidy/readability/ElseAfterReturnCheck.cpp
@@ -15,6 +15,7 @@
 
 namespace clang {
 namespace tidy {
+namespace readability {
 
 void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
   // FIXME: Support continue, break and throw.
@@ -41,6 +42,6 @@
     Diag << removeToken(CS->getLBracLoc()) << removeToken(CS->getRBracLoc());
 }
 
+} // namespace readability
 } // namespace tidy
 } // namespace clang
-
Index: clang-tidy/readability/ElseAfterReturnCheck.h
===================================================================
--- clang-tidy/readability/ElseAfterReturnCheck.h
+++ clang-tidy/readability/ElseAfterReturnCheck.h
@@ -14,6 +14,7 @@
 
 namespace clang {
 namespace tidy {
+namespace readability {
 
 class ElseAfterReturnCheck : public ClangTidyCheck {
 public:
@@ -23,8 +24,8 @@
   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
 };
 
+} // namespace readability
 } // namespace tidy
 } // namespace clang
 
 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ELSE_AFTER_RETURN_H
-
Index: clang-tidy/readability/ShrinkToFitCheck.cpp
===================================================================
--- clang-tidy/readability/ShrinkToFitCheck.cpp
+++ clang-tidy/readability/ShrinkToFitCheck.cpp
@@ -39,6 +39,7 @@
 
 namespace clang {
 namespace tidy {
+namespace readability {
 
 void ShrinkToFitCheck::registerMatchers(MatchFinder *Finder) {
   // Swap as a function need not to be considered, because rvalue can not
@@ -104,5 +105,6 @@
       << Hint;
 }
 
+} // namespace readability
 } // namespace tidy
 } // namespace clang
Index: clang-tidy/readability/ShrinkToFitCheck.h
===================================================================
--- clang-tidy/readability/ShrinkToFitCheck.h
+++ clang-tidy/readability/ShrinkToFitCheck.h
@@ -14,6 +14,7 @@
 
 namespace clang {
 namespace tidy {
+namespace readability {
 
 /// \brief Replace copy and swap tricks on shrinkable containers with the
 /// \c shrink_to_fit() method call.
@@ -29,6 +30,7 @@
   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
 };
 
+} // namespace readability
 } // namespace tidy
 } // namespace clang

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7997.20987.patch
Type: text/x-patch
Size: 2354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150302/2e08e614/attachment.bin>


More information about the cfe-commits mailing list