blob: d28bde40adaf378e4db577842e74b41ec04da6ba [file] [log] [blame]
Ben Hamilton52161a52017-11-13 23:54:31 +00001//===--- PropertyDeclarationCheck.h - clang-tidy-----------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Ben Hamilton52161a52017-11-13 23:54:31 +00006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
11
12#include "../ClangTidy.h"
13#include <string>
14#include <vector>
15
16namespace clang {
17namespace tidy {
18namespace objc {
19
20/// Finds Objective-C property declarations which
21/// are not in Lower Camel Case.
22///
23/// The format of property should look like:
24/// @property(nonatomic) NSString *lowerCamelCase;
25///
26/// For the user-facing documentation see:
27/// http://clang.llvm.org/extra/clang-tidy/checks/objc-property-declaration.html
28class PropertyDeclarationCheck : public ClangTidyCheck {
29public:
30 PropertyDeclarationCheck(StringRef Name, ClangTidyContext *Context);
31 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
32 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
33 void storeOptions(ClangTidyOptions::OptionMap &Options) override;
34
35private:
Ben Hamiltonf94c10d2018-01-22 15:45:25 +000036 const std::vector<std::string> SpecialAcronyms;
37 const bool IncludeDefaultAcronyms;
Yan Zhang75b3b542018-01-30 01:44:00 +000038 std::vector<std::string> EscapedAcronyms;
Ben Hamilton52161a52017-11-13 23:54:31 +000039};
40
41} // namespace objc
42} // namespace tidy
43} // namespace clang
44
45#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H