Files
pytorch/tools/vscode_settings.py
Edward Z. Yang a11c1bbdd0 Run Black on all of tools/
Signed-off-by: Edward Z. Yang <ezyangfb.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76089

Approved by: https://github.com/albanD
2022-04-20 17:29:41 +00:00

22 lines
480 B
Python
Executable File

#!/usr/bin/env python3
import json
from pathlib import Path
def main() -> None:
folder = Path(".vscode")
recommended = json.loads((folder / "settings_recommended.json").read_text())
path = folder / "settings.json"
try:
current = json.loads(path.read_text())
except Exception:
current = {}
with open(path, "w") as f:
json.dump({**current, **recommended}, f, indent=2)
f.write("\n")
if __name__ == "__main__":
main()