clang-tools 18.0.0git
|
#include <ClangTidyOptions.h>
Protected Types | |
using | ConfigFileHandler = std::pair< std::string, std::function< llvm::ErrorOr< ClangTidyOptions >(llvm::MemoryBufferRef)> > |
using | ConfigFileHandlers = std::vector< ConfigFileHandler > |
Configuration file handlers listed in the order of priority. | |
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) |
std::optional< OptionsSource > | tryReadConfigFile (llvm::StringRef Directory) |
Try to read configuration files from Directory using registered ConfigHandlers . | |
Protected Attributes | |
llvm::StringMap< OptionsSource > | CachedOptions |
ClangTidyOptions | OverrideOptions |
ConfigFileHandlers | ConfigHandlers |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | FS |
Additional Inherited Members | |
![]() | |
using | OptionsSource = std::pair< ClangTidyOptions, std::string > |
ClangTidyOptions and its source. | |
![]() | |
DefaultOptionsProvider (ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions Options) | |
const ClangTidyGlobalOptions & | getGlobalOptions () override |
Returns global options, which are independent of the file. | |
std::vector< OptionsSource > | getRawOptions (llvm::StringRef FileName) override |
Returns an ordered vector of OptionsSources, in order of increasing priority. | |
![]() | |
virtual | ~ClangTidyOptionsProvider () |
virtual const ClangTidyGlobalOptions & | getGlobalOptions ()=0 |
Returns global options, which are independent of the file. | |
virtual std::vector< OptionsSource > | getRawOptions (llvm::StringRef FileName)=0 |
Returns an ordered vector of OptionsSources, in order of increasing priority. | |
ClangTidyOptions | getOptions (llvm::StringRef FileName) |
Returns options applying to a specific translation unit with the specified FileName . | |
![]() | |
static const char | OptionsSourceTypeDefaultBinary [] |
static const char | OptionsSourceTypeCheckCommandLineOption [] |
static const char | OptionsSourceTypeConfigCommandLineOption [] |
Definition at line 198 of file ClangTidyOptions.h.
|
protected |
Definition at line 202 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 221 of file ClangTidyOptions.h.
|
protected |
Definition at line 312 of file ClangTidyOptions.cpp.
References ConfigHandlers, FS, and clang::tidy::parseConfiguration().
|
protected |
Definition at line 324 of file ClangTidyOptions.cpp.
|
protected |
Definition at line 333 of file ClangTidyOptions.cpp.
References CachedOptions, Path, and tryReadConfigFile().
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 413 of file ClangTidyOptions.cpp.
References ConfigFile(), ConfigHandlers, Directory, FS, and Text.
Referenced by addRawFileOptions().
|
protected |
Definition at line 240 of file ClangTidyOptions.h.
Referenced by addRawFileOptions().
|
protected |
Definition at line 242 of file ClangTidyOptions.h.
Referenced by FileOptionsBaseProvider(), and tryReadConfigFile().
|
protected |
Definition at line 243 of file ClangTidyOptions.h.
Referenced by FileOptionsBaseProvider(), clang::tidy::ConfigOptionsProvider::getRawOptions(), clang::tidy::FileOptionsProvider::getRawOptions(), and tryReadConfigFile().
|
protected |
Definition at line 241 of file ClangTidyOptions.h.
Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), and clang::tidy::FileOptionsProvider::getRawOptions().