1e34a761dSStephane Moore //===--- FunctionNamingCheck.h - clang-tidy ---------------------*- C++ -*-===// 2e34a761dSStephane Moore // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6e34a761dSStephane Moore // 7e34a761dSStephane Moore //===----------------------------------------------------------------------===// 8e34a761dSStephane Moore 9e34a761dSStephane Moore #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H 10e34a761dSStephane Moore #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H 11e34a761dSStephane Moore 12478fc5c8SAlexander Kornienko #include "../ClangTidyCheck.h" 13e34a761dSStephane Moore #include "llvm/ADT/StringRef.h" 14e34a761dSStephane Moore 15*4718da50SCarlos Galvez namespace clang::tidy::google::objc { 16e34a761dSStephane Moore 17e34a761dSStephane Moore /// Finds function names that do not conform to the recommendations of the 18e34a761dSStephane Moore /// Google Objective-C Style Guide. Function names should be in upper camel case 19e34a761dSStephane Moore /// including capitalized acronyms and initialisms. Functions that are not of 20e34a761dSStephane Moore /// static storage class must also have an appropriate prefix. The function 21e34a761dSStephane Moore /// `main` is an exception. Note that this check does not apply to Objective-C 22e34a761dSStephane Moore /// method or property declarations. 23e34a761dSStephane Moore /// 24e34a761dSStephane Moore /// For the user-facing documentation see: 256e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/google/objc-function-naming.html 26e34a761dSStephane Moore class FunctionNamingCheck : public ClangTidyCheck { 27e34a761dSStephane Moore public: FunctionNamingCheck(StringRef Name,ClangTidyContext * Context)28e34a761dSStephane Moore FunctionNamingCheck(StringRef Name, ClangTidyContext *Context) 29e34a761dSStephane Moore : ClangTidyCheck(Name, Context) {} isLanguageVersionSupported(const LangOptions & LangOpts)30e40a742aSNathan James bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { 31e40a742aSNathan James return LangOpts.ObjC; 32e40a742aSNathan James } 33e34a761dSStephane Moore void registerMatchers(ast_matchers::MatchFinder *Finder) override; 34e34a761dSStephane Moore void check(const ast_matchers::MatchFinder::MatchResult &Result) override; 35e34a761dSStephane Moore }; 36e34a761dSStephane Moore 37*4718da50SCarlos Galvez } // namespace clang::tidy::google::objc 38e34a761dSStephane Moore 39e34a761dSStephane Moore #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H 40