Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:21

0001 //===--- IdentifierLengthCheck.h - clang-tidy ---------------------*- C++
0002 //-*-===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERLENGTHCHECK_H
0011 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERLENGTHCHECK_H
0012 
0013 #include "../ClangTidyCheck.h"
0014 #include "llvm/Support/Regex.h"
0015 
0016 namespace clang::tidy::readability {
0017 
0018 /// Warns about identifiers names whose length is too short.
0019 ///
0020 /// For the user-facing documentation see:
0021 /// http://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html
0022 class IdentifierLengthCheck : public ClangTidyCheck {
0023 public:
0024   IdentifierLengthCheck(StringRef Name, ClangTidyContext *Context);
0025   void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
0026   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
0027   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
0028 
0029 private:
0030   const unsigned MinimumVariableNameLength;
0031   const unsigned MinimumLoopCounterNameLength;
0032   const unsigned MinimumExceptionNameLength;
0033   const unsigned MinimumParameterNameLength;
0034 
0035   std::string IgnoredVariableNamesInput;
0036   llvm::Regex IgnoredVariableNames;
0037 
0038   std::string IgnoredLoopCounterNamesInput;
0039   llvm::Regex IgnoredLoopCounterNames;
0040 
0041   std::string IgnoredExceptionVariableNamesInput;
0042   llvm::Regex IgnoredExceptionVariableNames;
0043 
0044   std::string IgnoredParameterNamesInput;
0045   llvm::Regex IgnoredParameterNames;
0046 };
0047 
0048 } // namespace clang::tidy::readability
0049 
0050 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERLENGTHCHECK_H