2016-05-20 17:30:37 -07:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
2016-08-21 10:31:43 -07:00
|
|
|
"""This script invokes format.py in the wpilibsuite/styleguide repository.
|
2016-07-12 21:59:09 -07:00
|
|
|
|
2016-08-21 10:31:43 -07:00
|
|
|
Set the WPI_FORMAT environment variable to its location on disk before use. For
|
|
|
|
|
example:
|
2016-07-12 21:59:09 -07:00
|
|
|
|
2016-08-21 10:31:43 -07:00
|
|
|
WPI_FORMAT="$HOME/styleguide" ./format.py
|
|
|
|
|
"""
|
2016-07-12 21:59:09 -07:00
|
|
|
|
2016-08-21 10:31:43 -07:00
|
|
|
import os
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
2016-07-12 21:59:09 -07:00
|
|
|
|
2016-07-10 08:33:27 -07:00
|
|
|
def main():
|
2016-08-21 10:31:43 -07:00
|
|
|
path = os.environ.get("WPI_FORMAT")
|
|
|
|
|
if path == None:
|
|
|
|
|
print("Error: WPI_FORMAT environment variable not set")
|
2016-07-10 08:33:27 -07:00
|
|
|
sys.exit(1)
|
|
|
|
|
|
2016-08-21 10:31:43 -07:00
|
|
|
# Run main format.py script
|
|
|
|
|
args = ["python", path + "/format.py"]
|
|
|
|
|
args.extend(sys.argv[1:])
|
|
|
|
|
proc = subprocess.Popen(args)
|
|
|
|
|
proc.wait()
|
2016-07-10 08:33:27 -07:00
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|