run_buildifier.py 540 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. """Runs buildifier on passed-in BUILD files, mainly for pre-commit."""
  3. __copyright__ = """
  4. Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  5. Exceptions. See /LICENSE for license information.
  6. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. """
  8. import os
  9. import sys
  10. import scripts_utils
  11. def main() -> None:
  12. buildifier = scripts_utils.get_release(scripts_utils.Release.BUILDIFIER)
  13. os.execv(buildifier, [buildifier] + sys.argv[1:])
  14. if __name__ == "__main__":
  15. main()