summaryrefslogtreecommitdiff
path: root/tools/format.py
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-21 14:45:04 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-21 13:59:53 -0700
commitbb9a927bd5477026b871ed5466ec188de8306d81 (patch)
tree2c4a8303bc307ebd83556ed33bbac4bc209201f4 /tools/format.py
parentef77d6f553380121d27eed034bf057baf81814ee (diff)
Add yapf to third_party.
Diffstat (limited to 'tools/format.py')
-rwxr-xr-xtools/format.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/format.py b/tools/format.py
index 0dc100b9f..5956432dc 100755
--- a/tools/format.py
+++ b/tools/format.py
@@ -2,6 +2,7 @@
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
from glob import glob
import os
+import sys
from third_party import third_party_path, fix_symlinks, google_env, clang_format_path
from util import root_path, run, find_exts, platform
@@ -26,8 +27,10 @@ for fn in ["BUILD.gn", ".gn"] + find_exts("build_extra", ".gn", ".gni"):
# 'third_party/v8/tools/clang', which contains many .py files.
# * These third party python files shouldn't be formatted.
# * The tools directory has no subdirectories, so `glob()` is sufficient.
-# TODO(ry) Install yapf in third_party.
-run(["yapf", "-i"] + glob("tools/*.py") + find_exts("build_extra", ".py"))
+
+run([sys.executable, "third_party/yapf/yapf", "-i"] + glob("tools/*.py") +
+ find_exts("build_extra", ".py"),
+ merge_env={"PYTHONPATH": "third_party/yapf"})
# yapf: disable
run(["node", prettier, "--write"] +