blob: 87932807d438f90f9eea554db7483664646d5a94 [file] [log] [blame]
Alexander Kornienkobef51cd2014-05-19 16:39:08 +00001//===--- 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
16namespace clang {
17namespace tidy {
18
19/// \brief Checks that long namespaces have a closing comment.
20///
21/// see: http://llvm.org/docs/CodingStandards.html#namespace-indentation
22class NamespaceCommentCheck : public ClangTidyCheck {
23public:
24 NamespaceCommentCheck();
25 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
26 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
27
28private:
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