0001_Add_hdrs.patch 978 B

12345678910111213141516171819202122232425
  1. From c2b1cfb7ec8ba667218382b97a986a3ef2f7ff56 Mon Sep 17 00:00:00 2001
  2. From: jonmeow <jperkins@google.com>
  3. Date: Fri, 5 Jan 2024 10:35:19 -0800
  4. Subject: [PATCH] Add hdrs so that clang-tidy runs on them directly.
  5. ---
  6. clang_tidy/clang_tidy.bzl | 3 +++
  7. 1 file changed, 3 insertions(+)
  8. diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl
  9. index 4d515fc..1af7ee4 100644
  10. --- a/clang_tidy/clang_tidy.bzl
  11. +++ b/clang_tidy/clang_tidy.bzl
  12. @@ -94,6 +94,9 @@ def _rule_sources(ctx):
  13. if hasattr(ctx.rule.attr, "srcs"):
  14. for src in ctx.rule.attr.srcs:
  15. srcs += [src for src in src.files.to_list() if src.is_source and check_valid_file_type(src)]
  16. + if hasattr(ctx.rule.attr, "hdrs"):
  17. + for src in ctx.rule.attr.hdrs:
  18. + srcs += [src for src in src.files.to_list() if src.is_source and check_valid_file_type(src)]
  19. return srcs
  20. def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile):
  21. --
  22. 2.43.0.472.g3155946c3a-goog