2014-05-20 00:39:08 +08:00
|
|
|
//===--- NamespaceCommentCheck.h - clang-tidy -------------------*- C++ -*-===//
|
2013-07-29 16:19:24 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-09-22 18:41:39 +08:00
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
|
2013-07-29 16:19:24 +08:00
|
|
|
|
|
|
|
#include "../ClangTidy.h"
|
2014-05-20 00:39:08 +08:00
|
|
|
#include "llvm/Support/Regex.h"
|
2013-07-29 16:19:24 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
2014-09-22 18:41:39 +08:00
|
|
|
namespace readability {
|
2013-07-29 16:19:24 +08:00
|
|
|
|
2015-08-28 02:01:58 +08:00
|
|
|
/// Checks that long namespaces have a closing comment.
|
2013-07-29 16:19:24 +08:00
|
|
|
///
|
2014-09-22 18:41:39 +08:00
|
|
|
/// http://llvm.org/docs/CodingStandards.html#namespace-indentation
|
2015-08-28 02:01:58 +08:00
|
|
|
///
|
2016-02-25 22:31:10 +08:00
|
|
|
/// https://google.github.io/styleguide/cppguide.html#Namespaces
|
2013-07-29 16:19:24 +08:00
|
|
|
class NamespaceCommentCheck : public ClangTidyCheck {
|
|
|
|
public:
|
2014-09-12 16:53:36 +08:00
|
|
|
NamespaceCommentCheck(StringRef Name, ClangTidyContext *Context);
|
2014-03-02 18:20:11 +08:00
|
|
|
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
2014-03-05 21:01:24 +08:00
|
|
|
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
2014-05-20 00:39:08 +08:00
|
|
|
|
|
|
|
private:
|
2014-09-12 16:53:36 +08:00
|
|
|
void storeOptions(ClangTidyOptions::OptionMap &Options) override;
|
|
|
|
|
2014-05-20 00:39:08 +08:00
|
|
|
llvm::Regex NamespaceCommentPattern;
|
|
|
|
const unsigned ShortNamespaceLines;
|
2014-09-12 16:53:36 +08:00
|
|
|
const unsigned SpacesBeforeComments;
|
2013-07-29 16:19:24 +08:00
|
|
|
};
|
|
|
|
|
2014-09-22 18:41:39 +08:00
|
|
|
} // namespace readability
|
2013-07-29 16:19:24 +08:00
|
|
|
} // namespace tidy
|
|
|
|
} // namespace clang
|
|
|
|
|
2014-09-22 18:41:39 +08:00
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
|