mirror of https://github.com/astral-sh/ruff
Formated.
This commit is contained in:
parent
998b8b57b7
commit
9ab5e06bcc
|
|
@ -15,9 +15,18 @@ TRIPLE = "x86_64-unknown-linux-gnu"
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["LLVM_PROFILE_FILE"] = f"{os.getcwd()}/target/pgo-profiles/ruff_%m_%p.profraw"
|
env["LLVM_PROFILE_FILE"] = f"{os.getcwd()}/target/pgo-profiles/ruff_%m_%p.profraw"
|
||||||
|
|
||||||
|
|
||||||
def run_command(cmd, env, cwd=None, check=False):
|
def run_command(cmd, env, cwd=None, check=False):
|
||||||
print(f">>> {cmd}")
|
print(f">>> {cmd}")
|
||||||
subprocess.run(cmd, shell=True, check=check, cwd=cwd, env=env, stdout = subprocess.DEVNULL, stderr= subprocess.DEVNULL)
|
subprocess.run(
|
||||||
|
cmd,
|
||||||
|
shell=True,
|
||||||
|
check=check,
|
||||||
|
cwd=cwd,
|
||||||
|
env=env,
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
@ -38,12 +47,21 @@ def main():
|
||||||
print(f">> collecting data on {name}.")
|
print(f">> collecting data on {name}.")
|
||||||
|
|
||||||
if not dest.exists():
|
if not dest.exists():
|
||||||
run_command(f"git clone --depth 1 --quiet --branch {branch} {url} {dest}", env=env)
|
run_command(
|
||||||
|
f"git clone --depth 1 --quiet --branch {branch} {url} {dest}", env=env
|
||||||
|
)
|
||||||
|
|
||||||
run_command(f"../../target/{TRIPLE}/release/ruff check -n -e --diff .", env=env, cwd=dest)
|
run_command(
|
||||||
run_command(f"../../target/{TRIPLE}/release/ruff format -n --check .", env=env, cwd=dest)
|
f"../../target/{TRIPLE}/release/ruff check -n -e --diff .",
|
||||||
|
env=env,
|
||||||
|
cwd=dest,
|
||||||
|
)
|
||||||
|
run_command(
|
||||||
|
f"../../target/{TRIPLE}/release/ruff format -n --check .", env=env, cwd=dest
|
||||||
|
)
|
||||||
|
|
||||||
run_command("cargo pgo optimize", env=env)
|
run_command("cargo pgo optimize", env=env)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
Loading…
Reference in New Issue