| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERLENGTHCHECK_H |
| 11 |
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERLENGTHCHECK_H |
| 12 |
|
| 13 |
#include "../ClangTidyCheck.h" |
| 14 |
#include "llvm/Support/Regex.h" |
| 15 |
|
| 16 |
namespace clang::tidy::readability { |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
class IdentifierLengthCheck : public ClangTidyCheck { |
| 23 |
public: |
| 24 |
IdentifierLengthCheck(StringRef Name, ClangTidyContext *Context); |
| 25 |
void storeOptions(ClangTidyOptions::OptionMap &Opts) override; |
| 26 |
void registerMatchers(ast_matchers::MatchFinder *Finder) override; |
| 27 |
void check(const ast_matchers::MatchFinder::MatchResult &Result) override; |
| 28 |
|
| 29 |
private: |
| 30 |
const unsigned MinimumVariableNameLength; |
| 31 |
const unsigned MinimumLoopCounterNameLength; |
| 32 |
const unsigned MinimumExceptionNameLength; |
| 33 |
const unsigned MinimumParameterNameLength; |
| 34 |
|
| 35 |
std::string IgnoredVariableNamesInput; |
| 36 |
llvm::Regex IgnoredVariableNames; |
| 37 |
|
| 38 |
std::string IgnoredLoopCounterNamesInput; |
| 39 |
llvm::Regex IgnoredLoopCounterNames; |
| 40 |
|
| 41 |
std::string IgnoredExceptionVariableNamesInput; |
| 42 |
llvm::Regex IgnoredExceptionVariableNames; |
| 43 |
|
| 44 |
std::string IgnoredParameterNamesInput; |
| 45 |
llvm::Regex IgnoredParameterNames; |
| 46 |
}; |
| 47 |
|
| 48 |
} |
| 49 |
|
| 50 |
#endif |