clang-tools
7.0.0
llvm.src
tools
clang
tools
extra
clang-tidy
readability
NamespaceCommentCheck.h
Go to the documentation of this file.
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_READABILITY_NAMESPACECOMMENTCHECK_H
11
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
12
13
#include "../ClangTidy.h"
14
#include "llvm/Support/Regex.h"
15
16
namespace
clang
{
17
namespace
tidy {
18
namespace
readability {
19
20
/// Checks that long namespaces have a closing comment.
21
///
22
/// http://llvm.org/docs/CodingStandards.html#namespace-indentation
23
///
24
/// https://google.github.io/styleguide/cppguide.html#Namespaces
25
class
NamespaceCommentCheck
:
public
ClangTidyCheck
{
26
public
:
27
NamespaceCommentCheck
(StringRef
Name
,
ClangTidyContext
*Context);
28
void
registerMatchers
(ast_matchers::MatchFinder *Finder)
override
;
29
void
check
(
const
ast_matchers::MatchFinder::MatchResult &Result)
override
;
30
31
private
:
32
void
storeOptions(
ClangTidyOptions::OptionMap
&
Options
)
override
;
33
34
llvm::Regex NamespaceCommentPattern;
35
const
unsigned
ShortNamespaceLines;
36
const
unsigned
SpacesBeforeComments;
37
llvm::SmallVector<SourceLocation, 4> Ends;
38
};
39
40
}
// namespace readability
41
}
// namespace tidy
42
}
// namespace clang
43
44
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
Name
llvm::StringRef Name
Definition:
CodeComplete.cpp:190
clang::tidy::readability::NamespaceCommentCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition:
NamespaceCommentCheck.cpp:36
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition:
ClangTidy.h:127
clang::tidy::readability::NamespaceCommentCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition:
NamespaceCommentCheck.cpp:68
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition:
ClangTidy.h:183
clang::tidy::ClangTidyOptions::OptionMap
std::map< std::string, std::string > OptionMap
Definition:
ClangTidyOptions.h:98
clang::tidy::readability::NamespaceCommentCheck
Checks that long namespaces have a closing comment.
Definition:
NamespaceCommentCheck.h:25
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition:
ChangeNamespace.cpp:16
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:100
clang::tidy::readability::NamespaceCommentCheck::NamespaceCommentCheck
NamespaceCommentCheck(StringRef Name, ClangTidyContext *Context)
Definition:
NamespaceCommentCheck.cpp:22
Generated on Mon Sep 17 2018 14:01:19 for clang-tools by
1.8.13