pw_presubmit: Run buildifier on Bazel files

If it's present on the system, run buildifier on Bazel files. If it's
not present, continue to check for trailing spaces.

Not getting buildifier from CIPD because the one version in CIPD doesn't
have proper platform strings and it looks hard to add buildifier to CIPD
the correct way.

Also run `pw format --fix` on all Bazel files.

Bug: 191
Change-Id: I5d33cfce6a94ad12bc812e72431f4e0e6baccfd5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54380
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
3 files changed
tree: 387e27efb24e5dc1488718a12bc098bc8ef630e1
  1. build_overrides/
  2. docker/
  3. docs/
  4. pw_allocator/
  5. pw_analog/
  6. pw_arduino_build/
  7. pw_assert/
  8. pw_assert_basic/
  9. pw_assert_log/
  10. pw_base64/
  11. pw_bloat/
  12. pw_blob_store/
  13. pw_boot/
  14. pw_boot_cortex_m/
  15. pw_build/
  16. pw_bytes/
  17. pw_checksum/
  18. pw_chrono/
  19. pw_chrono_embos/
  20. pw_chrono_freertos/
  21. pw_chrono_stl/
  22. pw_chrono_threadx/
  23. pw_cli/
  24. pw_console/
  25. pw_containers/
  26. pw_cpu_exception/
  27. pw_cpu_exception_cortex_m/
  28. pw_crypto/
  29. pw_docgen/
  30. pw_doctor/
  31. pw_env_setup/
  32. pw_function/
  33. pw_fuzzer/
  34. pw_hdlc/
  35. pw_hex_dump/
  36. pw_i2c/
  37. pw_interrupt/
  38. pw_interrupt_cortex_m/
  39. pw_kvs/
  40. pw_libc/
  41. pw_log/
  42. pw_log_basic/
  43. pw_log_multisink/
  44. pw_log_null/
  45. pw_log_rpc/
  46. pw_log_sink/
  47. pw_log_tokenized/
  48. pw_malloc/
  49. pw_malloc_freelist/
  50. pw_metric/
  51. pw_minimal_cpp_stdlib/
  52. pw_module/
  53. pw_multisink/
  54. pw_package/
  55. pw_persistent_ram/
  56. pw_polyfill/
  57. pw_preprocessor/
  58. pw_presubmit/
  59. pw_protobuf/
  60. pw_protobuf_compiler/
  61. pw_random/
  62. pw_result/
  63. pw_ring_buffer/
  64. pw_router/
  65. pw_rpc/
  66. pw_snapshot/
  67. pw_span/
  68. pw_status/
  69. pw_stm32cube_build/
  70. pw_stream/
  71. pw_string/
  72. pw_sync/
  73. pw_sync_baremetal/
  74. pw_sync_embos/
  75. pw_sync_freertos/
  76. pw_sync_stl/
  77. pw_sync_threadx/
  78. pw_sys_io/
  79. pw_sys_io_arduino/
  80. pw_sys_io_baremetal_lm3s6965evb/
  81. pw_sys_io_baremetal_stm32f429/
  82. pw_sys_io_stdio/
  83. pw_target_runner/
  84. pw_thread/
  85. pw_thread_embos/
  86. pw_thread_freertos/
  87. pw_thread_stl/
  88. pw_thread_threadx/
  89. pw_tls_client/
  90. pw_tls_client_boringssl/
  91. pw_tls_client_mbedtls/
  92. pw_tokenizer/
  93. pw_tool/
  94. pw_toolchain/
  95. pw_trace/
  96. pw_trace_tokenized/
  97. pw_transfer/
  98. pw_unit_test/
  99. pw_varint/
  100. pw_watch/
  101. pw_web_ui/
  102. targets/
  103. third_party/
  104. .bazelignore
  105. .bazelrc
  106. .clang-format
  107. .eslintrc.json
  108. .gitattributes
  109. .gitignore
  110. .gn
  111. .prettierrc.js
  112. .pylintrc
  113. activate.bat
  114. AUTHORS
  115. bootstrap.bat
  116. bootstrap.sh
  117. BUILD.bazel
  118. BUILD.gn
  119. BUILDCONFIG.gn
  120. CMakeLists.txt
  121. LICENSE
  122. modules.gni
  123. OWNERS
  124. package.json
  125. PW_PLUGINS
  126. README.md
  127. tsconfig.json
  128. WORKSPACE
  129. yarn.lock
README.md

See our website: http://pigweed.dev