table of contents
| 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
- Files to be processed (regex on path).
options:¶
- -h, --help
- show this help message and exit
- -allow-enabling-alpha-checkers
- Allow alpha checkers from clang-analyzer.
- -clang-tidy-binary PATH
- Path to clang-tidy binary.
- -clang-apply-replacements-binary PATH
- Path to clang-apply-replacements binary.
- -checks CHECKS
- Checks filter, when not specified, use clang-tidy default.
- -config CONFIG
- 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 CONFIG_FILE
- 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.
- -exclude-header-filter EXCLUDE_HEADER_FILTER
- Regular expression matching the names of the headers to exclude diagnostics from. Diagnostics from the main file of each translation unit are always displayed.
- -header-filter HEADER_FILTER
- Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed.
- -source-filter SOURCE_FILTER
- Regular expression matching the names of the source files from compilation database to output diagnostics from.
- -line-filter LINE_FILTER
- List of files and line ranges to output diagnostics from.
- -export-fixes file_or_directory
- 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.
- -j J
- Number of tidy instances to be run in parallel.
- -fix
- apply fix-its.
- -format
- Reformat code after applying fixes.
- -style STYLE
- The style of reformat code after applying fixes.
- -use-color [USE_COLOR]
- Use colors in diagnostics, overriding clang-tidy's default behavior. This option overrides the 'UseColor' option in .clang-tidy file, if any.
- -p BUILD_PATH
- Path used to read a compile command database.
- -extra-arg EXTRA_ARG
- Additional argument to append to the compiler command line.
- -extra-arg-before EXTRA_ARG_BEFORE
- Additional argument to prepend to the compiler command line.
- -removed-arg REMOVED_ARG
- Arguments to remove from the compiler command line.
- -quiet
- Run clang-tidy in quiet mode.
- -load PLUGINS
- Load the specified plugin in clang-tidy.
- -warnings-as-errors WARNINGS_AS_ERRORS
- Upgrades warnings to errors. Same format as '-checks'.
- -allow-no-checks
- Allow empty enabled checks.
- -enable-check-profile
- Enable per-check timing profiles, and print a report
- -hide-progress
- Hide progress
| November 2026 | run-clang-tidy.py 22 |