skvalidate.clang_tidy module

# Parallel clang-tidy runner.

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

Example invocations.

  • Run clang-tidy on all files in the current working directory with a default set of checks and show warnings in the cpp files and all project headers. $PWD
  • Fix all header guards. -fix -checks=-*,llvm-header-guard
  • Fix all header guards included from clang-tidy and header guards for clang-tidy headers. -fix -checks=-*,llvm-header-guard extra/clang-tidy -header-filter=extra/clang-tidy

Compilation database setup:

skvalidate.clang_tidy.apply_fixes(args, tmpdir)[source]

Call clang-apply-fixes on a given directory. Deletes the dir when done.


Check if invoking supplied clang-apply-replacements binary works.


Adjust the directory until a compilation database is found.

skvalidate.clang_tidy.get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, header_filter, extra_arg, extra_arg_before, quiet)[source]

Get a command line for clang-tidy.


Execute the script.

skvalidate.clang_tidy.run_tidy(args, tmpdir, build_path, queue)[source]

Take filenames out of queue and runs clang-tidy on them.