clang-tools 20.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 | |
Public Types inherited from clang::tidy::ClangTidyOptionsProvider | |
using | OptionsSource = std::pair< ClangTidyOptions, std::string > |
ClangTidyOptions and its source. | |
Public Member Functions inherited from clang::tidy::DefaultOptionsProvider | |
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. | |
Public Member Functions inherited from clang::tidy::ClangTidyOptionsProvider | |
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 Public Attributes inherited from clang::tidy::ClangTidyOptionsProvider | |
static const char | OptionsSourceTypeDefaultBinary [] |
static const char | OptionsSourceTypeCheckCommandLineOption [] |
static const char | OptionsSourceTypeConfigCommandLineOption [] |
Definition at line 202 of file ClangTidyOptions.h.
|
protected |
Definition at line 206 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 225 of file ClangTidyOptions.h.
|
protected |
Definition at line 316 of file ClangTidyOptions.cpp.
References ConfigHandlers, FS, and clang::tidy::parseConfiguration().
|
protected |
Definition at line 328 of file ClangTidyOptions.cpp.
|
protected |
Definition at line 337 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 417 of file ClangTidyOptions.cpp.
References ConfigFile(), ConfigHandlers, Directory, FS, and Text.
Referenced by addRawFileOptions().
|
protected |
Definition at line 244 of file ClangTidyOptions.h.
Referenced by addRawFileOptions().
|
protected |
Definition at line 246 of file ClangTidyOptions.h.
Referenced by FileOptionsBaseProvider(), and tryReadConfigFile().
|
protected |
Definition at line 247 of file ClangTidyOptions.h.
Referenced by FileOptionsBaseProvider(), clang::tidy::ConfigOptionsProvider::getRawOptions(), clang::tidy::FileOptionsProvider::getRawOptions(), and tryReadConfigFile().
|
protected |
Definition at line 245 of file ClangTidyOptions.h.
Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), and clang::tidy::FileOptionsProvider::getRawOptions().