Commit 04bb510c authored by Z Duong Nguyen-Huu's avatar Z Duong Nguyen-Huu Committed by Commit Bot

Reland "Make format torque tools work on win"

This is a reland of 1fdf6405

Original change's description:
> Make format torque tools work on win
>
> Reformatting Torque file is required to upload a CL
> but it can only work on POSIX
>
> Change-Id: I51283e3f6b29abf492be7efb5b8f10454d09fb37
> Reviewed-on: https://chromium-review.googlesource.com/c/1475919
> Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> Commit-Queue: Michael Stanton <mvstanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59719}

Change-Id: I09a19a9989091205eb413fd60b2e8bec289092fd
Reviewed-on: https://chromium-review.googlesource.com/c/1479530
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59748}
parent db69e088
......@@ -95,7 +95,10 @@ def process(filename, lint, should_format):
original_input = content
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
if sys.platform.startswith('win'):
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True)
else:
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(preprocess(content))
output = postprocess(output)
rc = p.returncode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment