blob: b2683baedc569757e490a833dfe1e5f32f36f0e2 [file] [log] [blame]
Ben Hamilton52161a52017-11-13 23:54:31 +00001//===--- PropertyDeclarationCheck.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_OBJC_PROPERTY_DECLARATION_H
11#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
12
13#include "../ClangTidy.h"
14#include <string>
15#include <vector>
16
17namespace clang {
18namespace tidy {
19namespace objc {
20
21/// Finds Objective-C property declarations which
22/// are not in Lower Camel Case.
23///
24/// The format of property should look like:
25/// @property(nonatomic) NSString *lowerCamelCase;
26///
27/// For the user-facing documentation see:
28/// http://clang.llvm.org/extra/clang-tidy/checks/objc-property-declaration.html
29class PropertyDeclarationCheck : public ClangTidyCheck {
30public:
31 PropertyDeclarationCheck(StringRef Name, ClangTidyContext *Context);
32 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
33 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
34 void storeOptions(ClangTidyOptions::OptionMap &Options) override;
35
36private:
Ben Hamiltonf94c10d2018-01-22 15:45:25 +000037 const std::vector<std::string> SpecialAcronyms;
38 const bool IncludeDefaultAcronyms;
Yan Zhang75b3b542018-01-30 01:44:00 +000039 std::vector<std::string> EscapedAcronyms;
Ben Hamilton52161a52017-11-13 23:54:31 +000040};
41
42} // namespace objc
43} // namespace tidy
44} // namespace clang
45
46#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H