clang-tools
15.0.0git
|
#include <ClangTidyOptions.h>
Protected Types | |
typedef std::pair< std::string, std::function< llvm::ErrorOr< ClangTidyOptions > llvm::MemoryBufferRef)> > | ConfigFileHandler |
typedef std::vector< ConfigFileHandler > | ConfigFileHandlers |
Configuration file handlers listed in the order of priority. More... | |
Protected Member Functions | |
FileOptionsBaseProvider (ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions, ClangTidyOptions OverrideOptions, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS) | |
FileOptionsBaseProvider (ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions, ClangTidyOptions OverrideOptions, ConfigFileHandlers ConfigHandlers) | |
void | addRawFileOptions (llvm::StringRef AbsolutePath, std::vector< OptionsSource > &CurOptions) |
llvm::Optional< OptionsSource > | tryReadConfigFile (llvm::StringRef Directory) |
Try to read configuration files from Directory using registered ConfigHandlers . More... | |
Protected Attributes | |
llvm::StringMap< OptionsSource > | CachedOptions |
ClangTidyOptions | OverrideOptions |
ConfigFileHandlers | ConfigHandlers |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | FS |
Additional Inherited Members | |
![]() | |
typedef std::pair< ClangTidyOptions, std::string > | OptionsSource |
ClangTidyOptions and its source. More... | |
![]() | |
DefaultOptionsProvider (ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions Options) | |
const ClangTidyGlobalOptions & | getGlobalOptions () override |
Returns global options, which are independent of the file. More... | |
std::vector< OptionsSource > | getRawOptions (llvm::StringRef FileName) override |
Returns an ordered vector of OptionsSources, in order of increasing priority. More... | |
![]() | |
virtual | ~ClangTidyOptionsProvider () |
ClangTidyOptions | getOptions (llvm::StringRef FileName) |
Returns options applying to a specific translation unit with the specified FileName . More... | |
![]() | |
static const char | OptionsSourceTypeDefaultBinary [] |
static const char | OptionsSourceTypeCheckCommandLineOption [] |
static const char | OptionsSourceTypeConfigCommandLineOption [] |
Definition at line 191 of file ClangTidyOptions.h.
|
protected |
Definition at line 197 of file ClangTidyOptions.h.
|
protected |
Configuration file handlers listed in the order of priority.
Custom configuration file formats can be supported by constructing the list of handlers and passing it to the appropriate FileOptionsProvider
constructor. E.g. initialization of a FileOptionsProvider
with support of a custom configuration file format for files named ".my-tidy-config" could look similar to this:
With the order of handlers shown above, the ".my-tidy-config" file would take precedence over ".clang-tidy" if both reside in the same directory.
Definition at line 216 of file ClangTidyOptions.h.
|
protected |
Definition at line 228 of file ClangTidyOptions.cpp.
|
protected |
Definition at line 240 of file ClangTidyOptions.cpp.
|
protected |
Definition at line 249 of file ClangTidyOptions.cpp.
References Path.
Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), and clang::tidy::FileOptionsProvider::getRawOptions().
|
protected |
Try to read configuration files from Directory
using registered ConfigHandlers
.
Definition at line 329 of file ClangTidyOptions.cpp.
References ConfigFile(), ConfigHandlers, Directory, FS, and Text.
|
protected |
Definition at line 236 of file ClangTidyOptions.h.
|
protected |
Definition at line 238 of file ClangTidyOptions.h.
Referenced by tryReadConfigFile().
|
protected |
Definition at line 239 of file ClangTidyOptions.h.
Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), clang::tidy::FileOptionsProvider::getRawOptions(), and tryReadConfigFile().
|
protected |
Definition at line 237 of file ClangTidyOptions.h.
Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), and clang::tidy::FileOptionsProvider::getRawOptions().