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.

run-clang-tidy.py $PWD
  • Fix all header guards.

run-clang-tidy.py -fix -checks=-*,llvm-header-guard
  • Fix all header guards included from clang-tidy and header guards for clang-tidy headers.

run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy -header-filter=extra/clang-tidy

Compilation database setup: http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html

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

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

skvalidate.clang_tidy.check_clang_apply_replacements_binary(args)[source]

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

skvalidate.clang_tidy.find_compilation_database(path)[source]

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.

skvalidate.clang_tidy.main()[source]

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.