clang-tools 8.0.0

FunctionNamingCheck.h
Go to the documentation of this file.
1 //===--- FunctionNamingCheck.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_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H
12
13 #include "../ClangTidy.h"
14 #include "llvm/ADT/StringRef.h"
15
16 namespace clang {
17 namespace tidy {
18 namespace google {
19 namespace objc {
20
21 /// Finds function names that do not conform to the recommendations of the
22 /// Google Objective-C Style Guide. Function names should be in upper camel case
23 /// including capitalized acronyms and initialisms. Functions that are not of
24 /// static storage class must also have an appropriate prefix. The function
25 /// `main` is an exception. Note that this check does not apply to Objective-C
26 /// method or property declarations.
27 ///
28 /// For the user-facing documentation see:
29 /// http://clang.llvm.org/extra/clang-tidy/checks/google-objc-function-naming.html
30 class FunctionNamingCheck : public ClangTidyCheck {
31 public:
32 FunctionNamingCheck(StringRef Name, ClangTidyContext *Context)
33 : ClangTidyCheck(Name, Context) {}
34 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
35 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
36 };
37
38 } // namespace objc
39 } // namespace google
40 } // namespace tidy
41 } // namespace clang
42
43 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H
clang::tidy::google::objc::FunctionNamingCheck
Finds function names that do not conform to the recommendations of the Google Objective-C Style Guide...
Definition: FunctionNamingCheck.h:30
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
clang::tidy::google::objc::FunctionNamingCheck::FunctionNamingCheck
FunctionNamingCheck(StringRef Name, ClangTidyContext *Context)
Definition: FunctionNamingCheck.h:32
Name
static constexpr llvm::StringLiteral Name
Definition: UppercaseLiteralSuffixCheck.cpp:28
Result
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
Definition: ClangdServer.cpp:60
clang::tidy::google::objc::FunctionNamingCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: FunctionNamingCheck.cpp:110
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:100
clang::tidy::google::objc::FunctionNamingCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition: FunctionNamingCheck.cpp:92