[clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions

Classes are named WhateverCheck, files are WhateverCheck.cpp and`
WhateverCheck.h`

http://reviews.llvm.org/D8144

Patch by Richard Thomson!

llvm-svn: 231650
This commit is contained in:
Alexander Kornienko 2015-03-09 12:18:39 +00:00
parent 1d2c052e9f
commit 1b677dbd44
9 changed files with 31 additions and 32 deletions

View File

@ -11,9 +11,9 @@
#include "../ClangTidyModule.h"
#include "../ClangTidyModuleRegistry.h"
#include "../readability/BracesAroundStatementsCheck.h"
#include "../readability/FunctionSize.h"
#include "../readability/FunctionSizeCheck.h"
#include "../readability/NamespaceCommentCheck.h"
#include "../readability/RedundantSmartptrGet.h"
#include "../readability/RedundantSmartptrGetCheck.h"
#include "AvoidCStyleCastsCheck.h"
#include "ExplicitConstructorCheck.h"
#include "ExplicitMakePairCheck.h"
@ -69,7 +69,7 @@ public:
.registerCheck<clang::tidy::readability::NamespaceCommentCheck>(
"google-readability-namespace-comments");
CheckFactories
.registerCheck<clang::tidy::readability::RedundantSmartptrGet>(
.registerCheck<clang::tidy::readability::RedundantSmartptrGetCheck>(
"google-readability-redundant-smartptr-get");
}

View File

@ -2,12 +2,12 @@ set(LLVM_LINK_COMPONENTS support)
add_clang_library(clangTidyReadabilityModule
BracesAroundStatementsCheck.cpp
ContainerSizeEmpty.cpp
ContainerSizeEmptyCheck.cpp
ElseAfterReturnCheck.cpp
FunctionSize.cpp
FunctionSizeCheck.cpp
NamespaceCommentCheck.cpp
ReadabilityTidyModule.cpp
RedundantSmartptrGet.cpp
RedundantSmartptrGetCheck.cpp
ShrinkToFitCheck.cpp
LINK_LIBS

View File

@ -1,4 +1,4 @@
//===--- ContainerSizeEmpty.cpp - clang-tidy ------------------------------===//
//===--- ContainerSizeEmptyCheck.cpp - clang-tidy -------------------------===//
//
// The LLVM Compiler Infrastructure
//
@ -6,7 +6,7 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "ContainerSizeEmpty.h"
#include "ContainerSizeEmptyCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Lex/Lexer.h"

View File

@ -1,4 +1,4 @@
//===--- ContainerSizeEmpty.h - clang-tidy ----------------------*- C++ -*-===//
//===--- ContainerSizeEmptyCheck.h - clang-tidy -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTY_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTY_H
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
#include "../ClangTidy.h"
@ -37,4 +37,4 @@ public:
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTY_H
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H

View File

@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include "FunctionSize.h"
#include "FunctionSizeCheck.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
using namespace clang::ast_matchers;

View File

@ -1,4 +1,4 @@
//===--- FunctionSize.h - clang-tidy ----------------------------*- C++ -*-===//
//===--- FunctionSizeCheck.h - clang-tidy -----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZE_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZE_H
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
#include "../ClangTidy.h"
@ -45,4 +45,4 @@ private:
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZE_H
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H

View File

@ -11,10 +11,10 @@
#include "../ClangTidyModule.h"
#include "../ClangTidyModuleRegistry.h"
#include "BracesAroundStatementsCheck.h"
#include "ContainerSizeEmpty.h"
#include "ContainerSizeEmptyCheck.h"
#include "ElseAfterReturnCheck.h"
#include "FunctionSize.h"
#include "RedundantSmartptrGet.h"
#include "FunctionSizeCheck.h"
#include "RedundantSmartptrGetCheck.h"
#include "ShrinkToFitCheck.h"
namespace clang {
@ -32,7 +32,7 @@ public:
"readability-else-after-return");
CheckFactories.registerCheck<FunctionSizeCheck>(
"readability-function-size");
CheckFactories.registerCheck<RedundantSmartptrGet>(
CheckFactories.registerCheck<RedundantSmartptrGetCheck>(
"readability-redundant-smartptr-get");
CheckFactories.registerCheck<ShrinkToFitCheck>(
"readability-shrink-to-fit");

View File

@ -1,4 +1,4 @@
//===--- RedundantSmartptrGet.cpp - clang-tidy ----------------------------===//
//===--- RedundantSmartptrGetCheck.cpp - clang-tidy -----------------------===//
//
// The LLVM Compiler Infrastructure
//
@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include "RedundantSmartptrGet.h"
#include "RedundantSmartptrGetCheck.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
@ -73,7 +73,7 @@ void registerMatchersForGetEquals(MatchFinder *Finder,
} // namespace
void RedundantSmartptrGet::registerMatchers(MatchFinder *Finder) {
void RedundantSmartptrGetCheck::registerMatchers(MatchFinder *Finder) {
registerMatchersForGetArrowStart(Finder, this);
registerMatchersForGetEquals(Finder, this);
}
@ -96,7 +96,7 @@ bool allReturnTypesMatch(const MatchFinder::MatchResult &Result) {
}
} // namespace
void RedundantSmartptrGet::check(const MatchFinder::MatchResult &Result) {
void RedundantSmartptrGetCheck::check(const MatchFinder::MatchResult &Result) {
if (!allReturnTypesMatch(Result)) return;
bool IsPtrToPtr = Result.Nodes.getNodeAs<Decl>("ptr_to_ptr") != nullptr;

View File

@ -1,4 +1,4 @@
//===--- RedundantSmartptrGet.h - clang-tidy --------------------*- C++ -*-===//
//===--- RedundantSmartptrGetCheck.h - clang-tidy ---------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGET_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGET_H
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
#include "../ClangTidy.h"
@ -22,9 +22,9 @@ namespace readability {
/// ptr.get()->Foo() ==> ptr->Foo()
/// *ptr.get() ==> *ptr
/// *ptr->get() ==> **ptr
class RedundantSmartptrGet : public ClangTidyCheck {
class RedundantSmartptrGetCheck : public ClangTidyCheck {
public:
RedundantSmartptrGet(StringRef Name, ClangTidyContext *Context)
RedundantSmartptrGetCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
@ -34,5 +34,4 @@ public:
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGET_H
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H