Scroll to navigation

RUN-CLANG-TIDY.PY(1) User Commands RUN-CLANG-TIDY.PY(1)

NAME

run-clang-tidy.py - run clang-tidy in parallel over a compilation database

DESCRIPTION

usage: run-clang-tidy.py [-h] [-allow-enabling-alpha-checkers]

[-clang-tidy-binary PATH]
[-clang-apply-replacements-binary PATH] [-checks CHECKS] [-config CONFIG | -config-file CONFIG_FILE] [-exclude-header-filter EXCLUDE_HEADER_FILTER] [-header-filter HEADER_FILTER] [-source-filter SOURCE_FILTER] [-line-filter LINE_FILTER] [-export-fixes file_or_directory] [-j J] [-fix] [-format] [-style STYLE] [-use-color [USE_COLOR]] [-p BUILD_PATH] [-extra-arg EXTRA_ARG] [-extra-arg-before EXTRA_ARG_BEFORE] [-removed-arg REMOVED_ARG] [-quiet] [-load PLUGINS] [-warnings-as-errors WARNINGS_AS_ERRORS] [-allow-no-checks] [-enable-check-profile] [-hide-progress] [files ...]

Runs clang-tidy over all files in a compilation database. Requires clang-tidy and clang-apply-replacements in $PATH or in your build directory.

positional arguments:

Files to be processed (regex on path).

options:

show this help message and exit
Allow alpha checkers from clang-analyzer.
Path to clang-tidy binary.
Path to clang-apply-replacements binary.
Checks filter, when not specified, use clang-tidy default.
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.
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. Use either -config-file or -config, not both.
Regular expression matching the names of the headers to exclude diagnostics from. Diagnostics from the main file of each translation unit are always displayed.
Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed.
Regular expression matching the names of the source files from compilation database to output diagnostics from.
List of files and line ranges to output diagnostics from.
A directory or a yaml file to store suggested fixes in, which can be applied with clang-applyreplacements. If the parameter is a directory, the fixes of each compilation unit are stored in individual yaml files in the directory.
Number of tidy instances to be run in parallel.
apply fix-its.
Reformat code after applying fixes.
The style of reformat code after applying fixes.
Use colors in diagnostics, overriding clang-tidy's default behavior. This option overrides the 'UseColor' option in .clang-tidy file, if any.
Path used to read a compile command database.
Additional argument to append to the compiler command line.
Additional argument to prepend to the compiler command line.
Arguments to remove from the compiler command line.
Run clang-tidy in quiet mode.
Load the specified plugin in clang-tidy.
Upgrades warnings to errors. Same format as '-checks'.
Allow empty enabled checks.
Enable per-check timing profiles, and print a report
Hide progress
November 2026 run-clang-tidy.py 22