BUILD 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("@mypy_integration//:mypy.bzl", "mypy_test")
  5. py_library(
  6. name = "scripts_utils",
  7. srcs = ["scripts_utils.py"],
  8. )
  9. # Note that this Python script is intended to be run directly, and not through
  10. # Bazel. We have a rule for it so we can type check it.
  11. py_binary(
  12. name = "create_compdb",
  13. testonly = 1,
  14. srcs = ["create_compdb.py"],
  15. deps = [":scripts_utils"],
  16. )
  17. mypy_test(
  18. name = "create_compdb_mypy_test",
  19. include_imports = True,
  20. deps = [":create_compdb"],
  21. )
  22. # Note that this Python script is intended to be run directly, and not through
  23. # Bazel. We have a rule for it so we can type check it.
  24. py_binary(
  25. name = "fix_cc_deps",
  26. testonly = 1,
  27. srcs = ["fix_cc_deps.py"],
  28. deps = [":scripts_utils"],
  29. )
  30. mypy_test(
  31. name = "fix_cc_deps_mypy_test",
  32. include_imports = True,
  33. deps = [":fix_cc_deps"],
  34. )
  35. # Note that this Python script is intended to be run directly, and not through
  36. # Bazel. We have a rule for it so we can type check it.
  37. py_binary(
  38. name = "forbid_llvm_googletest",
  39. testonly = 1,
  40. srcs = ["forbid_llvm_googletest.py"],
  41. deps = [":scripts_utils"],
  42. )
  43. mypy_test(
  44. name = "forbid_llvm_googletest_mypy_test",
  45. include_imports = True,
  46. deps = [":forbid_llvm_googletest"],
  47. )
  48. # Note that this Python script is intended to be run directly, and not through
  49. # Bazel. We have a rule for it so we can type check it.
  50. py_binary(
  51. name = "run_bazel",
  52. testonly = 1,
  53. srcs = ["run_bazel.py"],
  54. deps = [":scripts_utils"],
  55. )
  56. mypy_test(
  57. name = "run_bazel_mypy_test",
  58. include_imports = True,
  59. deps = [":run_bazel"],
  60. )
  61. # Note that this Python script is intended to be run directly, and not through
  62. # Bazel. We have a rule for it so we can type check it.
  63. py_binary(
  64. name = "run_buildifier",
  65. testonly = 1,
  66. srcs = ["run_buildifier.py"],
  67. deps = [":scripts_utils"],
  68. )
  69. mypy_test(
  70. name = "run_buildifier_mypy_test",
  71. include_imports = True,
  72. deps = [":run_buildifier"],
  73. )
  74. # Note that this Python script is intended to be run directly, and not through
  75. # Bazel. We have a rule for it so we can type check it.
  76. py_binary(
  77. name = "run_buildozer",
  78. testonly = 1,
  79. srcs = ["run_buildozer.py"],
  80. deps = [":scripts_utils"],
  81. )
  82. mypy_test(
  83. name = "run_buildozer_mypy_test",
  84. include_imports = True,
  85. deps = [":run_buildozer"],
  86. )