Revert "[torque] change formatter to emit LF newlines on Windows"

This reverts commit d8c471ffa1.

Reason for revert: breaks waterfall

Original change's description:
> [torque] change formatter to emit LF newlines on Windows
> 
> Otherwise, it will always replace LF with CRLF, which is not what you
> want if you follow the Chromium instructions for Windows, that is,
> configure git with core.autocrlf = false.
> 
> Change-Id: I30fcfc471cde79d5c80d05ce582a8507cf5810b5
> Reviewed-on: https://chromium-review.googlesource.com/c/1345150
> Reviewed-by: Daniel Clifford <danno@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57691}

TBR=danno@chromium.org,tebbi@chromium.org

Change-Id: Ib30ae0d5b1803dbe8e6e8a0928cc41a6ce2d2bb8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1346502
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57695}
This commit is contained in:
Tobias Tebbi 2018-11-21 18:06:17 +00:00 committed by Commit Bot
parent 4685349480
commit 621de4bd2c

View File

@ -9,7 +9,6 @@ the source and header files directly in V8's src directory."""
import subprocess
import sys
import re
import io
from subprocess import Popen, PIPE
def preprocess(input):
@ -83,13 +82,13 @@ def postprocess(output):
return output
def process(filename, only_lint, use_stdout):
with io.open(filename, 'r') as content_file:
with open(filename, 'r') as content_file:
content = content_file.read()
original_input = content
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(preprocess(content).encode('utf-8'))
output, err = p.communicate(preprocess(content))
output = postprocess(output)
rc = p.returncode
if (rc <> 0):
@ -102,8 +101,8 @@ def process(filename, only_lint, use_stdout):
elif use_stdout:
print output
else:
output_file = io.open(filename, 'w', newline="\n")
output_file.write(output.decode('utf-8'));
output_file = open(filename, 'w')
output_file.write(output);
output_file.close()
def print_usage():