[PATCH] D143804: [bazel] create a clang-tidy binary target

Aaron Siddhartha Mondal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 11 04:13:14 PST 2023


aaronmondal added a comment.

I'm a big fan of the `expand_template` for that questionable one-define header. Very clean 👍
I do think it'd be better to set `CLANG_STATIC_ANALYZER 1` though as we build the static analyzer targets anyways.

I think it makes much sense to have a finer grained buildfile: If the coarse grained target fails to build, Bazel will rebuild ALL sources of this. Clang Tidy is a large target. Caching would really suffer if we have to rebuild everything if someone changes a single check ever so slightly.

Also, I'd like to propose adding the multithreaded clang-tidy-runner:

  load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
  
  ...
  
  native_binary(
      name = "run-clang-tidy",
      src = "tool/run-clang-tidy.py",
      out = "run-clang-tidy",
      data = [":clang-tidy"],
      visibility = ["//visibility:public"],
  )

as well, since running clang tidy single threaded will be rather limited in application.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143804/new/

https://reviews.llvm.org/D143804



More information about the llvm-commits mailing list