[clang-tidy] Move google-readability-function check to readability-named-parameter.

Summary: The relevant style rule is going to be removed, thus the check is no longer needed in the Google module. Leaving the check in readability/ in case someone needs it.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D8261

llvm-svn: 232431
This commit is contained in:
Alexander Kornienko 2015-03-16 22:31:16 +00:00
parent 55cfaa2552
commit c5bc68e7ab
7 changed files with 14 additions and 12 deletions

View File

@ -8,7 +8,6 @@ add_clang_library(clangTidyGoogleModule
GoogleTidyModule.cpp
IntegerTypesCheck.cpp
MemsetZeroLengthCheck.cpp
NamedParameterCheck.cpp
OverloadedUnaryAndCheck.cpp
StringReferenceMemberCheck.cpp
TodoCommentCheck.cpp

View File

@ -20,7 +20,6 @@
#include "GlobalNamesInHeadersCheck.h"
#include "IntegerTypesCheck.h"
#include "MemsetZeroLengthCheck.h"
#include "NamedParameterCheck.h"
#include "OverloadedUnaryAndCheck.h"
#include "StringReferenceMemberCheck.h"
#include "TodoCommentCheck.h"
@ -54,8 +53,6 @@ public:
"google-runtime-memset");
CheckFactories.registerCheck<readability::AvoidCStyleCastsCheck>(
"google-readability-casting");
CheckFactories.registerCheck<readability::NamedParameterCheck>(
"google-readability-function");
CheckFactories.registerCheck<readability::TodoCommentCheck>(
"google-readability-todo");
CheckFactories

View File

@ -5,6 +5,7 @@ add_clang_library(clangTidyReadabilityModule
ContainerSizeEmptyCheck.cpp
ElseAfterReturnCheck.cpp
FunctionSizeCheck.cpp
NamedParameterCheck.cpp
NamespaceCommentCheck.cpp
ReadabilityTidyModule.cpp
RedundantStringCStrCheck.cpp

View File

@ -16,7 +16,6 @@ using namespace clang::ast_matchers;
namespace clang {
namespace tidy {
namespace google {
namespace readability {
void NamedParameterCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
@ -122,6 +121,5 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
}
} // namespace readability
} // namespace google
} // namespace tidy
} // namespace clang

View File

@ -7,19 +7,24 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_NAMEDPARAMETERCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_NAMEDPARAMETERCHECK_H
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
#include "../ClangTidy.h"
namespace clang {
namespace tidy {
namespace google {
namespace readability {
/// \brief Find functions with unnamed arguments.
///
/// The check implements the following rule originating in the Google C++ Style
/// Guide:
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Declarations_and_Definitions#Function_Declarations_and_Definitions
///
/// All parameters should be named, with identical names in the declaration and
/// implementation.
///
/// Corresponding cpplint.py check name: 'readability/function'.
class NamedParameterCheck : public ClangTidyCheck {
public:
@ -30,8 +35,7 @@ public:
};
} // namespace readability
} // namespace google
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_NAMEDPARAMETERCHECK_H
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H

View File

@ -14,6 +14,7 @@
#include "ContainerSizeEmptyCheck.h"
#include "ElseAfterReturnCheck.h"
#include "FunctionSizeCheck.h"
#include "NamedParameterCheck.h"
#include "RedundantSmartptrGetCheck.h"
#include "RedundantStringCStrCheck.h"
#include "ShrinkToFitCheck.h"
@ -33,6 +34,8 @@ public:
"readability-else-after-return");
CheckFactories.registerCheck<FunctionSizeCheck>(
"readability-function-size");
CheckFactories.registerCheck<readability::NamedParameterCheck>(
"readability-named-parameter");
CheckFactories.registerCheck<RedundantSmartptrGetCheck>(
"readability-redundant-smartptr-get");
CheckFactories.registerCheck<RedundantStringCStrCheck>(

View File

@ -1,4 +1,4 @@
// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-function %t
// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-named-parameter %t
// REQUIRES: shell
void Method(char *) { /* */ }