| Alexander Kornienko | bef51cd | 2014-05-19 16:39:08 +0000 | [diff] [blame^] | 1 | //===--- NamespaceCommentCheck.h - clang-tidy -------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_NAMESPACE_COMMENT_CHECK_H |
| 11 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_NAMESPACE_COMMENT_CHECK_H |
| 12 | |
| 13 | #include "../ClangTidy.h" |
| 14 | #include "llvm/Support/Regex.h" |
| 15 | |
| 16 | namespace clang { |
| 17 | namespace tidy { |
| 18 | |
| 19 | /// \brief Checks that long namespaces have a closing comment. |
| 20 | /// |
| 21 | /// see: http://llvm.org/docs/CodingStandards.html#namespace-indentation |
| 22 | class NamespaceCommentCheck : public ClangTidyCheck { |
| 23 | public: |
| 24 | NamespaceCommentCheck(); |
| 25 | void registerMatchers(ast_matchers::MatchFinder *Finder) override; |
| 26 | void check(const ast_matchers::MatchFinder::MatchResult &Result) override; |
| 27 | |
| 28 | private: |
| 29 | llvm::Regex NamespaceCommentPattern; |
| 30 | const unsigned ShortNamespaceLines; |
| 31 | }; |
| 32 | |
| 33 | } // namespace tidy |
| 34 | } // namespace clang |
| 35 | |
| 36 | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_NAMESPACE_COMMENT_CHECK_H |