Skip to content

Commit 6958348

Browse files
committed
[clang-tidy] Rename 'google-build-namespaces' check to 'misc-anonymous-namespace-in-header'
1 parent a805147 commit 6958348

File tree

8 files changed

+18
-15
lines changed

8 files changed

+18
-15
lines changed

clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
#include "../bugprone/UnsafeFunctionsCheck.h"
3232
#include "../bugprone/UnusedReturnValueCheck.h"
3333
#include "../concurrency/ThreadCanceltypeAsynchronousCheck.h"
34-
#include "../google/UnnamedNamespaceInHeaderCheck.h"
3534
#include "../misc/NewDeleteOverloadsCheck.h"
3635
#include "../misc/NonCopyableObjectsCheck.h"
3736
#include "../misc/PredictableRandCheck.h"
3837
#include "../misc/StaticAssertCheck.h"
3938
#include "../misc/ThrowByValueCatchByReferenceCheck.h"
39+
#include "../misc/UnnamedNamespaceInHeaderCheck.h"
4040
#include "../modernize/AvoidSetjmpLongjmpCheck.h"
4141
#include "../modernize/AvoidVariadicFunctionsCheck.h"
4242
#include "../performance/MoveConstructorInitCheck.h"
@@ -253,7 +253,7 @@ class CERTModule : public ClangTidyModule {
253253
"cert-dcl54-cpp");
254254
CheckFactories.registerCheck<bugprone::StdNamespaceModificationCheck>(
255255
"cert-dcl58-cpp");
256-
CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
256+
CheckFactories.registerCheck<misc::build::UnnamedNamespaceInHeaderCheck>(
257257
"cert-dcl59-cpp");
258258
// ERR
259259
CheckFactories.registerCheck<misc::ThrowByValueCatchByReferenceCheck>(

clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "../ClangTidy.h"
1010
#include "../ClangTidyModule.h"
1111
#include "../ClangTidyModuleRegistry.h"
12-
#include "../google/UnnamedNamespaceInHeaderCheck.h"
12+
#include "../misc/UnnamedNamespaceInHeaderCheck.h"
1313
#include "DefaultArgumentsCallsCheck.h"
1414
#include "DefaultArgumentsDeclarationsCheck.h"
1515
#include "MultipleInheritanceCheck.h"
@@ -32,7 +32,7 @@ class FuchsiaModule : public ClangTidyModule {
3232
"fuchsia-default-arguments-calls");
3333
CheckFactories.registerCheck<DefaultArgumentsDeclarationsCheck>(
3434
"fuchsia-default-arguments-declarations");
35-
CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
35+
CheckFactories.registerCheck<misc::build::UnnamedNamespaceInHeaderCheck>(
3636
"fuchsia-header-anon-namespaces");
3737
CheckFactories.registerCheck<MultipleInheritanceCheck>(
3838
"fuchsia-multiple-inheritance");

clang-tools-extra/clang-tidy/google/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ add_clang_library(clangTidyGoogleModule STATIC
1919
IntegerTypesCheck.cpp
2020
OverloadedUnaryAndCheck.cpp
2121
TodoCommentCheck.cpp
22-
UnnamedNamespaceInHeaderCheck.cpp
2322
UpgradeGoogletestCaseCheck.cpp
2423
UsingNamespaceDirectiveCheck.cpp
2524

clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "../ClangTidy.h"
1010
#include "../ClangTidyModule.h"
1111
#include "../ClangTidyModuleRegistry.h"
12+
#include "../misc/UnnamedNamespaceInHeaderCheck.h"
1213
#include "../readability/BracesAroundStatementsCheck.h"
1314
#include "../readability/FunctionSizeCheck.h"
1415
#include "../readability/NamespaceCommentCheck.h"
@@ -26,7 +27,6 @@
2627
#include "IntegerTypesCheck.h"
2728
#include "OverloadedUnaryAndCheck.h"
2829
#include "TodoCommentCheck.h"
29-
#include "UnnamedNamespaceInHeaderCheck.h"
3030
#include "UpgradeGoogletestCaseCheck.h"
3131
#include "UsingNamespaceDirectiveCheck.h"
3232

@@ -40,7 +40,7 @@ class GoogleModule : public ClangTidyModule {
4040
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
4141
CheckFactories.registerCheck<build::ExplicitMakePairCheck>(
4242
"google-build-explicit-make-pair");
43-
CheckFactories.registerCheck<build::UnnamedNamespaceInHeaderCheck>(
43+
CheckFactories.registerCheck<misc::build::UnnamedNamespaceInHeaderCheck>(
4444
"google-build-namespaces");
4545
CheckFactories.registerCheck<build::UsingNamespaceDirectiveCheck>(
4646
"google-build-using-namespace");

clang-tools-extra/clang-tidy/misc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ add_clang_library(clangTidyMiscModule STATIC
3939
ThrowByValueCatchByReferenceCheck.cpp
4040
UnconventionalAssignOperatorCheck.cpp
4141
UniqueptrResetReleaseCheck.cpp
42+
UnnamedNamespaceInHeaderCheck.cpp
4243
UnusedAliasDeclsCheck.cpp
4344
UnusedParametersCheck.cpp
4445
UnusedUsingDeclsCheck.cpp

clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "ThrowByValueCatchByReferenceCheck.h"
3030
#include "UnconventionalAssignOperatorCheck.h"
3131
#include "UniqueptrResetReleaseCheck.h"
32+
#include "UnnamedNamespaceInHeaderCheck.h"
3233
#include "UnusedAliasDeclsCheck.h"
3334
#include "UnusedParametersCheck.h"
3435
#include "UnusedUsingDeclsCheck.h"
@@ -41,6 +42,8 @@ namespace misc {
4142
class MiscModule : public ClangTidyModule {
4243
public:
4344
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
45+
CheckFactories.registerCheck<build::UnnamedNamespaceInHeaderCheck>(
46+
"misc-anonymous-namespace-in-header");
4447
CheckFactories.registerCheck<ConfusableIdentifierCheck>(
4548
"misc-confusable-identifiers");
4649
CheckFactories.registerCheck<ConstCorrectnessCheck>(

clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp renamed to clang-tools-extra/clang-tidy/misc/UnnamedNamespaceInHeaderCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
using namespace clang::ast_matchers;
1414

15-
namespace clang::tidy::google::build {
15+
namespace clang::tidy::misc::build {
1616

1717
UnnamedNamespaceInHeaderCheck::UnnamedNamespaceInHeaderCheck(
1818
StringRef Name, ClangTidyContext *Context)
@@ -37,4 +37,4 @@ void UnnamedNamespaceInHeaderCheck::check(
3737
diag(Loc, "do not use unnamed namespaces in header files");
3838
}
3939

40-
} // namespace clang::tidy::google::build
40+
} // namespace clang::tidy::misc::build

clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h renamed to clang-tools-extra/clang-tidy/misc/UnnamedNamespaceInHeaderCheck.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UNNAMEDNAMESPACEINHEADERCHECK_H
10-
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UNNAMEDNAMESPACEINHEADERCHECK_H
9+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNNAMEDNAMESPACEINHEADERCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNNAMEDNAMESPACEINHEADERCHECK_H
1111

1212
#include "../ClangTidyCheck.h"
1313
#include "../utils/FileExtensionsUtils.h"
1414

15-
namespace clang::tidy::google::build {
15+
namespace clang::tidy::misc::build {
1616

1717
/// Finds anonymous namespaces in headers.
1818
///
@@ -21,7 +21,7 @@ namespace clang::tidy::google::build {
2121
/// Corresponding cpplint.py check name: 'build/namespaces'.
2222
///
2323
/// For the user-facing documentation see:
24-
/// https://clang.llvm.org/extra/clang-tidy/checks/google/build-namespaces.html
24+
/// https://clang.llvm.org/extra/clang-tidy/checks/misc/build-namespaces.html
2525
class UnnamedNamespaceInHeaderCheck : public ClangTidyCheck {
2626
public:
2727
UnnamedNamespaceInHeaderCheck(StringRef Name, ClangTidyContext *Context);
@@ -35,6 +35,6 @@ class UnnamedNamespaceInHeaderCheck : public ClangTidyCheck {
3535
FileExtensionsSet HeaderFileExtensions;
3636
};
3737

38-
} // namespace clang::tidy::google::build
38+
} // namespace clang::tidy::misc::build
3939

40-
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UNNAMEDNAMESPACEINHEADERCHECK_H
40+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNNAMEDNAMESPACEINHEADERCHECK_H

0 commit comments

Comments
 (0)