mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Always run yapf with vpython3.
The version we are using now does not run under python 2.7. Add an explicit python_version 3.8 to the inline spec so that we don't rely on vpython's default version. This is a no-op change when running with vpython3. We should run yapf under 3.11, but this needs additional testing and likely an update of zipp, so we'll do it separately. Change-Id: If1fccbe6b13c77a770bd1a8c9de0789d543ba890 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5198109 Auto-Submit: Brian Ryner <bryner@google.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -6286,13 +6286,7 @@ def _RunYapf(opts, paths, top_dir, upstream_commit):
|
|||||||
if not yapf_style:
|
if not yapf_style:
|
||||||
yapf_style = 'pep8'
|
yapf_style = 'pep8'
|
||||||
|
|
||||||
with open(path, 'r') as py_f:
|
cmd = ['vpython3', yapf_tool, '--style', yapf_style, path]
|
||||||
if 'python2' in py_f.readline():
|
|
||||||
vpython_script = 'vpython'
|
|
||||||
else:
|
|
||||||
vpython_script = 'vpython3'
|
|
||||||
|
|
||||||
cmd = [vpython_script, yapf_tool, '--style', yapf_style, path]
|
|
||||||
|
|
||||||
if not opts.full:
|
if not opts.full:
|
||||||
ranges = line_diffs.get(path)
|
ranges = line_diffs.get(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user