[PATCH] [clang-tidy] Add a namespace checker.

Alexander Kornienko alexfh at google.com
Wed Jul 16 02:48:11 PDT 2014


================
Comment at: clang-tidy/google/NamespacesCheck.h:19
@@ +18,3 @@
+
+/// \brief Finds anonymous namespaces in headers and using namespace directives.
+/// Corresponding cpplint.py check name: 'build/namespaces'.
----------------
Daniel Jasper wrote:
> IMO, "using namespace directives" should be detected in a separate check, there doesn't seem to be a strong relation to the empty namespaces in headers.
nit: Add an empty line after the \brief line?

================
Comment at: clang-tidy/google/NamespacesCheck.h:20
@@ +19,3 @@
+/// \brief Finds anonymous namespaces in headers and using namespace directives.
+/// Corresponding cpplint.py check name: 'build/namespaces'.
+class NamespacesCheck : public ClangTidyCheck {
----------------
Daniel Jasper wrote:
> I actually don't think we should keep references to a different tool. The meaning of "build/namespaces" might change making this comment stale. This check is good on its own without a specific reference.
The main use of this is if we'll want to support categorized NOLINT comments: "// NOLINT(build/namespaces)", then it would be nice to have them in the same form.

http://reviews.llvm.org/D4523






More information about the cfe-commits mailing list