mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-17 21:10:43 +00:00
Description: Format all python files under onnxruntime with black and isort. After checking in, we can use .git-blame-ignore-revs to ignore the formatting PR in git blame. #11315, #11316
29 lines
556 B
Python
29 lines
556 B
Python
#!/usr/bin/env python3
|
|
|
|
# args: <submodule path>
|
|
# output: <path> <url> <commit>
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
assert len(sys.argv) == 2
|
|
|
|
path = sys.argv[1]
|
|
|
|
proc = subprocess.run(
|
|
["git", "config", "--get", "remote.origin.url"],
|
|
check=True,
|
|
cwd=path,
|
|
stdout=subprocess.PIPE,
|
|
universal_newlines=True,
|
|
)
|
|
|
|
url = proc.stdout.strip()
|
|
|
|
proc = subprocess.run(
|
|
["git", "rev-parse", "HEAD"], check=True, cwd=path, stdout=subprocess.PIPE, universal_newlines=True
|
|
)
|
|
|
|
commit = proc.stdout.strip()
|
|
|
|
print("{} {} {}".format(path, url, commit))
|