Skip to content

clang_tidy

clang-tidy documentation

ClangTidy

Bases: Tool[_R]

Methods:

Name Description
__call__

Run this verb.

Attributes:

Name Type Description
argv ClangTidy[Argv]

argv property

argv: ClangTidy[Argv]

__call__

__call__(*args: str | PathLike[str], allow_no_checks: Flag = ..., checks: Value = ..., config: Value = ..., config_file: Value = ..., dump_config: Flag = ..., enable_check_profile: Flag = ..., enable_module_headers_parsing: Flag = ..., exclude_header_filter: Value = ..., explain_config: Flag = ..., export_fixes: Value = ..., extra_arg: Value = ..., extra_arg_before: Value = ..., fix: Flag = ..., fix_errors: Flag = ..., fix_notes: Flag = ..., format_style: Value = ..., header_filter: Value = ..., help_list: Flag = ..., line_filter: Value = ..., list_checks: Flag = ..., load: Value = ..., p: Value = ..., quiet: Flag = ..., store_check_profile: Value = ..., system_headers: Flag = ..., use_color: Flag = ..., verify_config: Flag = ..., vfsoverlay: Value = ..., warnings_as_errors: Value = ..., **flags: Any) -> _R

Run this verb.

Parameters:

Name Type Description Default
allow_no_checks Flag
  • Allow empty enabled checks.
...
checks Value
  • Comma-separated list of globs with optional '-' prefix.
...
config Value
  • Specifies a configuration in YAML/JSON format: -config="{Checks: '*', CheckOptions: {x: y}}" When the value is empty, clang-tidy will attempt to find a file named .clang-tidy for each source file in its parent directories.
...
config_file Value
  • Specify the path of .clang-tidy or custom config file: e.g. --config-file=/some/path/myTidyConfigFile This option internally works exactly the same way as --config option after reading specified config file.
...
dump_config Flag
  • Dumps configuration in the YAML format to stdout.
...
enable_check_profile Flag
  • Enable per-check timing profiles, and print a report to stderr.
...
enable_module_headers_parsing Flag
  • Enables preprocessor-level module header parsing for C++20 and above, empowering specific checks to detect macro definitions within modules.
...
exclude_header_filter Value

headers to exclude diagnostics from. May be repeated: a list emits the flag once per item.

...
explain_config Flag
  • For each enabled check explains, where it is enabled, i.e. in clang-tidy binary, command line or a specific configuration file.
...
export_fixes Value
  • YAML file to store suggested fixes in.
...
extra_arg Value
  • Additional argument to append to the compiler command line.
...
extra_arg_before Value
  • Additional argument to prepend to the compiler command line.
...
fix Flag
  • Apply suggested fixes.
...
fix_errors Flag
  • Apply suggested fixes even if compilation errors were found.
...
fix_notes Flag
  • If a warning has no fix, but a single fix can be found through an associated diagnostic note, apply the fix.
...
format_style Value
  • Style for formatting code around applied fixes: - 'none' (default) turns off formatting - 'file' (literally 'file', not a placeholder) uses .clang-format file in the closest parent directory - '{ }' specifies options inline, e.g. -format-style='{BasedOnStyle: llvm, IndentWidth: 8}' - 'llvm', 'google', 'webkit', 'mozilla' See clang-format documentation for the up-to-date information about formatting styles and options.
...
header_filter Value
  • Regular expression matching the names of the headers to output diagnostics from. May be repeated: a list emits the flag once per item.
...
help_list Flag
  • Display list of available options (--help-list-hidden for more).
...
line_filter Value
  • List of files with line ranges to filter the warnings. May be repeated: a list emits the flag once per item.
...
list_checks Flag
  • List all enabled checks and exit.
...
load Value
  • Load the specified plugin.
...
p Value
  • Build path.
...
quiet Flag
  • Run clang-tidy in quiet mode.
...
store_check_profile Value
  • By default reports are printed in tabulated format to stderr.
...
system_headers Flag
  • Display the errors from system headers.
...
use_color Flag
  • Use colors in diagnostics.
...
verify_config Flag
  • Check the config files to ensure each check and option is recognized.
...
vfsoverlay Value
  • Overlay the virtual filesystem described by file over the real file system.
...
warnings_as_errors Value
  • Upgrades warnings to errors.
...