clang-tools 20.0.0git
Public Types | Public Member Functions | Static Public Attributes | List of all members
clang::tidy::ClangTidyOptionsProvider Class Referenceabstract

Abstract interface for retrieving various ClangTidy options. More...

#include <ClangTidyOptions.h>

Inheritance diagram for clang::tidy::ClangTidyOptionsProvider:
Inheritance graph
[legend]

Public Types

using OptionsSource = std::pair< ClangTidyOptions, std::string >
 ClangTidyOptions and its source.
 

Public Member Functions

virtual ~ClangTidyOptionsProvider ()
 
virtual const ClangTidyGlobalOptionsgetGlobalOptions ()=0
 Returns global options, which are independent of the file.
 
virtual std::vector< OptionsSourcegetRawOptions (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

static const char OptionsSourceTypeDefaultBinary []
 
static const char OptionsSourceTypeCheckCommandLineOption []
 
static const char OptionsSourceTypeConfigCommandLineOption []
 

Detailed Description

Abstract interface for retrieving various ClangTidy options.

Definition at line 153 of file ClangTidyOptions.h.

Member Typedef Documentation

◆ OptionsSource

ClangTidyOptions and its source.

clang-tidy has 3 types of the sources in order of increasing priority:

  • clang-tidy binary.
  • '-config' commandline option or a specific configuration file. If the commandline option is specified, clang-tidy will ignore the configuration file.
  • '-checks' commandline option.

Definition at line 172 of file ClangTidyOptions.h.

Constructor & Destructor Documentation

◆ ~ClangTidyOptionsProvider()

virtual clang::tidy::ClangTidyOptionsProvider::~ClangTidyOptionsProvider ( )
inlinevirtual

Definition at line 159 of file ClangTidyOptions.h.

Member Function Documentation

◆ getGlobalOptions()

virtual const ClangTidyGlobalOptions & clang::tidy::ClangTidyOptionsProvider::getGlobalOptions ( )
pure virtual

Returns global options, which are independent of the file.

Implemented in clang::tidy::DefaultOptionsProvider.

◆ getOptions()

ClangTidyOptions clang::tidy::ClangTidyOptionsProvider::getOptions ( llvm::StringRef  FileName)

Returns options applying to a specific translation unit with the specified FileName.

Definition at line 270 of file ClangTidyOptions.cpp.

References FileName, and getRawOptions().

◆ getRawOptions()

virtual std::vector< OptionsSource > clang::tidy::ClangTidyOptionsProvider::getRawOptions ( llvm::StringRef  FileName)
pure virtual

Returns an ordered vector of OptionsSources, in order of increasing priority.

Implemented in clang::tidy::DefaultOptionsProvider, clang::tidy::ConfigOptionsProvider, and clang::tidy::FileOptionsProvider.

Referenced by getOptions().

Member Data Documentation

◆ OptionsSourceTypeCheckCommandLineOption

const char clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeCheckCommandLineOption
static
Initial value:
=
"command-line option '-checks'"

Definition at line 156 of file ClangTidyOptions.h.

Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), and clang::tidy::FileOptionsProvider::getRawOptions().

◆ OptionsSourceTypeConfigCommandLineOption

const char clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeConfigCommandLineOption
static
Initial value:
=
"command-line option '-config'"

Definition at line 157 of file ClangTidyOptions.h.

Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions().

◆ OptionsSourceTypeDefaultBinary

const char clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeDefaultBinary
static
Initial value:
=
"clang-tidy binary"

Definition at line 155 of file ClangTidyOptions.h.

Referenced by clang::tidy::DefaultOptionsProvider::getRawOptions().


The documentation for this class was generated from the following files: