Skip to content

Commit 44ffad5

Browse files
bkonyicommit-bot@chromium.org
authored andcommitted
Pass filename instead of piping contents through stdin to dart format in
PRESUBMIT.py FIXES=#46600 Change-Id: I69358185b5a8dfc863f17cd4beb0209592d3be09 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206681 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
1 parent 723df3d commit 44ffad5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

PRESUBMIT.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,13 @@ def HasFormatErrors(filename=None, contents=None):
133133
dart,
134134
'format',
135135
'--set-exit-if-changed',
136+
'--output=none',
137+
'--summary=none',
138+
filename,
136139
]
137-
if not contents:
138-
args += [
139-
'--output=none',
140-
'--summary=none',
141-
filename,
142-
]
143140

144141
process = subprocess.Popen(
145142
args, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
146-
process.communicate(input=contents)
147143

148144
# Check for exit code 1 explicitly to distinguish it from a syntax error
149145
# in the file (exit code 65). The repo contains many Dart files that are

0 commit comments

Comments
 (0)