Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d39206f

Browse files
author
Dart CI
committed
Version 2.15.0-18.0.dev
Merge commit 'd2bd43f43e6636036a3d250eadcd429c444b7540' into 'dev'
2 parents af6f6cf + d2bd43f commit d39206f

File tree

9 files changed

+68
-98
lines changed

9 files changed

+68
-98
lines changed

PRESUBMIT.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23
# for details. All rights reserved. Use of this source code is governed by a
34
# BSD-style license that can be found in the LICENSE file.
@@ -10,11 +11,14 @@
1011
import imp
1112
import os
1213
import os.path
14+
from typing import Callable
1315
import scm
1416
import subprocess
15-
import tempfile
1617
import platform
1718

19+
USE_PYTHON3 = True
20+
21+
1822
def is_cpp_file(path):
1923
return path.endswith('.cc') or path.endswith('.h')
2024

@@ -68,7 +72,7 @@ def _CheckFormat(input_api,
6872
identification,
6973
extension,
7074
windows,
71-
hasFormatErrors,
75+
hasFormatErrors: Callable[[str, str], bool],
7276
should_skip=lambda path: False):
7377
local_root = input_api.change.RepositoryRoot()
7478
upstream = input_api.change._upstream
@@ -105,7 +109,6 @@ def _CheckFormat(input_api,
105109

106110
def _CheckDartFormat(input_api, output_api):
107111
local_root = input_api.change.RepositoryRoot()
108-
upstream = input_api.change._upstream
109112
utils = imp.load_source('utils',
110113
os.path.join(local_root, 'tools', 'utils.py'))
111114

@@ -119,7 +122,7 @@ def _CheckDartFormat(input_api, output_api):
119122
print('WARNING: dart not found: %s' % (dart))
120123
return []
121124

122-
def HasFormatErrors(filename=None, contents=None):
125+
def HasFormatErrors(filename: str = None, contents: str = None):
123126
# Don't look for formatting errors in multitests. Since those are very
124127
# sensitive to whitespace, many cannot be formatted with dartfmt without
125128
# breaking them.
@@ -135,11 +138,12 @@ def HasFormatErrors(filename=None, contents=None):
135138
'--set-exit-if-changed',
136139
'--output=none',
137140
'--summary=none',
138-
filename,
139141
]
140-
141-
process = subprocess.Popen(
142-
args, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
142+
if contents:
143+
process = subprocess.run(args, input=contents, text=True)
144+
else:
145+
args.append(filename)
146+
process = subprocess.run(args)
143147

144148
# Check for exit code 1 explicitly to distinguish it from a syntax error
145149
# in the file (exit code 65). The repo contains many Dart files that are
@@ -158,16 +162,15 @@ def HasFormatErrors(filename=None, contents=None):
158162
output_api.PresubmitError(
159163
'File output does not match dartfmt.\n'
160164
'Fix these issues with:\n'
161-
'%s -w%s%s' % (prebuilt_dartfmt, lineSep,
162-
lineSep.join(unformatted_files)))
165+
'%s format %s%s' %
166+
(dart, lineSep, lineSep.join(unformatted_files)))
163167
]
164168

165169
return []
166170

167171

168172
def _CheckStatusFiles(input_api, output_api):
169173
local_root = input_api.change.RepositoryRoot()
170-
upstream = input_api.change._upstream
171174
utils = imp.load_source('utils',
172175
os.path.join(local_root, 'tools', 'utils.py'))
173176

@@ -188,9 +191,7 @@ def _CheckStatusFiles(input_api, output_api):
188191

189192
def HasFormatErrors(filename=None, contents=None):
190193
args = [dart, lint] + (['-t'] if contents else [filename])
191-
process = subprocess.Popen(
192-
args, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
193-
process.communicate(input=contents)
194+
process = subprocess.run(args, input=contents, text=True)
194195
return process.returncode != 0
195196

196197
def should_skip(path):
@@ -230,12 +231,8 @@ def _CheckPackageConfigUpToDate(input_api, output_api):
230231
dart = utils.CheckedInSdkExecutable()
231232
generate = os.path.join(local_root, 'tools', 'generate_package_config.dart')
232233
cmd = [dart, generate, '--check']
233-
pipe = subprocess.Popen(cmd,
234-
stdout=subprocess.PIPE,
235-
stderr=subprocess.PIPE,
236-
shell=utils.IsWindows())
237-
output = pipe.communicate()
238-
if pipe.returncode != 0:
234+
result = subprocess.run(cmd, shell=utils.IsWindows())
235+
if result.returncode != 0:
239236
return [
240237
output_api.PresubmitError(
241238
'File .dart_tool/package_config.json is out of date.\n'
@@ -255,7 +252,7 @@ def _CheckValidHostsInDEPS(input_api, output_api):
255252
try:
256253
input_api.subprocess.check_output(['gclient', 'verify'])
257254
return []
258-
except input_api.subprocess.CalledProcessError, error:
255+
except input_api.subprocess.CalledProcessError as error:
259256
return [
260257
output_api.PresubmitError(
261258
'DEPS file must have only dependencies from allowed hosts.',

pkg/_fe_analyzer_shared/PRESUBMIT.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
23
# for details. All rights reserved. Use of this source code is governed by a
34
# BSD-style license that can be found in the LICENSE file.
@@ -11,6 +12,8 @@
1112
import os.path
1213
import subprocess
1314

15+
USE_PYTHON3 = True
16+
1417

1518
def runSmokeTest(input_api, output_api):
1619
hasChangedFiles = False

pkg/front_end/PRESUBMIT.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
23
# for details. All rights reserved. Use of this source code is governed by a
34
# BSD-style license that can be found in the LICENSE file.
@@ -11,6 +12,8 @@
1112
import os.path
1213
import subprocess
1314

15+
USE_PYTHON3 = True
16+
1417

1518
def runSmokeTest(input_api, output_api):
1619
hasChangedFiles = False

pkg/kernel/PRESUBMIT.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
23
# for details. All rights reserved. Use of this source code is governed by a
34
# BSD-style license that can be found in the LICENSE file.
@@ -11,6 +12,8 @@
1112
import os.path
1213
import subprocess
1314

15+
USE_PYTHON3 = True
16+
1417

1518
def runSmokeTest(input_api, output_api):
1619
hasChangedFiles = False

runtime/PRESUBMIT.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
#!/usr/bin/env python3
12
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
23
# for details. All rights reserved. Use of this source code is governed by a
34
# BSD-style license that can be found in the LICENSE file.
45

56
import os
67
import cpplint
78
import re
8-
import StringIO
99

10+
USE_PYTHON3 = True
1011

1112
# memcpy does not handle overlapping memory regions. Even though this
1213
# is well documented it seems to be used in error quite often. To avoid

tests/co19/co19-dart2js.status

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,24 @@ LibTest/html/HttpRequestUpload/*: Skip # https://github.com/dart-lang/co19/issue
5959
LibTest/io/*: SkipByDesign # dart:io not supported.
6060
LibTest/isolate/*: SkipByDesign # dart:isolate not supported.
6161
LibTest/mirrors/*: SkipByDesign # dart:mirrors is not supported
62-
LibTest/typed_data/ByteBuffer/*: SkipByDesign # not supported on the web
63-
LibTest/typed_data/ByteData/getInt64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
64-
LibTest/typed_data/ByteData/getInt64_A02_t01: SkipByDesign # Int64 accessor not supported by dart2js
65-
LibTest/typed_data/ByteData/getInt64_A02_t02: SkipByDesign # Int64 accessor not supported by dart2js
66-
LibTest/typed_data/ByteData/getUint64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
67-
LibTest/typed_data/ByteData/getUint64_A02_t01: SkipByDesign # Int64 accessor not supported by dart2js
68-
LibTest/typed_data/ByteData/getUint64_A02_t02: SkipByDesign # Int64 accessor not supported by dart2js
69-
LibTest/typed_data/ByteData/setInt64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
70-
LibTest/typed_data/ByteData/setInt64_A02_t01: SkipByDesign # Int64 accessor not supported by dart2js
71-
LibTest/typed_data/ByteData/setInt64_A02_t02: SkipByDesign # Int64 accessor not supported by dart2js
72-
LibTest/typed_data/ByteData/setUint64_A01_t01: SkipByDesign # uses integer literal not representable as JavaScript number
73-
LibTest/typed_data/ByteData/setUint64_A02_t01: SkipByDesign # Uint64 accessor not supported by dart2js
74-
LibTest/typed_data/ByteData/setUint64_A02_t02: SkipByDesign # Uint64 accessor not supported by dart2js
75-
LibTest/typed_data/Int32x4/operator_OR_A01_t01: SkipByDesign # Bitwise operations in JS are unsigned.
76-
LibTest/typed_data/Int32x4List/join_A01_t01: SkipByDesign # Different string represrntation on VM and in JS
77-
LibTest/typed_data/Int32x4List/join_A01_t02: SkipByDesign # Different string represrntation on VM and in JS
62+
LibTest/typed_data/ByteBuffer/asInt64List_A01_t01: SkipByDesign # Int64List not supported on the web
63+
LibTest/typed_data/ByteBuffer/asInt64List_A02_t01: SkipByDesign # Int64List not supported on the web
64+
LibTest/typed_data/ByteBuffer/asInt64List_A03_t01: SkipByDesign # Int64List not supported on the web
65+
LibTest/typed_data/ByteBuffer/asUint64List_A01_t01: SkipByDesign # UInt64List not supported on the web
66+
LibTest/typed_data/ByteBuffer/asUint64List_A02_t01: SkipByDesign # UInt64List not supported on the web
67+
LibTest/typed_data/ByteBuffer/asUint64List_A03_t01: SkipByDesign # UInt64List not supported on the web
68+
LibTest/typed_data/ByteData/getInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
69+
LibTest/typed_data/ByteData/getInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
70+
LibTest/typed_data/ByteData/getInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
71+
LibTest/typed_data/ByteData/getUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
72+
LibTest/typed_data/ByteData/getUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
73+
LibTest/typed_data/ByteData/getUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
74+
LibTest/typed_data/ByteData/setInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
75+
LibTest/typed_data/ByteData/setInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
76+
LibTest/typed_data/ByteData/setInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
77+
LibTest/typed_data/ByteData/setUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
78+
LibTest/typed_data/ByteData/setUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
79+
LibTest/typed_data/ByteData/setUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
7880
LibTest/typed_data/Int64List/*: SkipByDesign # Int64List not supported on the web
7981
LibTest/typed_data/Uint64List/*: SkipByDesign # Uint64List not supported on the web
8082

tests/co19_2/co19_2-dart2js.status

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ Language/Libraries_and_Scripts/top_level_syntax_t01: SkipByDesign # Non-JS-inter
1414
Language/Metadata/before*: SkipByDesign # dart:mirrors not supported https://github.com/dart-lang/co19/issues/523.
1515
LibTest/io/*: SkipByDesign # dart:io not supported.
1616
LibTest/isolate/*: SkipByDesign # dart:isolate not supported.
17+
LibTest/typed_data/ByteBuffer/asInt64List_A01_t01: SkipByDesign # Int64List not supported on the web
18+
LibTest/typed_data/ByteBuffer/asInt64List_A02_t01: SkipByDesign # Int64List not supported on the web
19+
LibTest/typed_data/ByteBuffer/asInt64List_A03_t01: SkipByDesign # Int64List not supported on the web
20+
LibTest/typed_data/ByteBuffer/asUint64List_A01_t01: SkipByDesign # UInt64List not supported on the web
21+
LibTest/typed_data/ByteBuffer/asUint64List_A02_t01: SkipByDesign # UInt64List not supported on the web
22+
LibTest/typed_data/ByteBuffer/asUint64List_A03_t01: SkipByDesign # UInt64List not supported on the web
23+
LibTest/typed_data/ByteData/getInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
24+
LibTest/typed_data/ByteData/getInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
25+
LibTest/typed_data/ByteData/getInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
26+
LibTest/typed_data/ByteData/getUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
27+
LibTest/typed_data/ByteData/getUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
28+
LibTest/typed_data/ByteData/getUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
29+
LibTest/typed_data/ByteData/setInt64_A01_t01: SkipByDesign # 64-bit int not supported on the web
30+
LibTest/typed_data/ByteData/setInt64_A02_t01: SkipByDesign # 64-bit int not supported on the web
31+
LibTest/typed_data/ByteData/setInt64_A02_t02: SkipByDesign # 64-bit int not supported on the web
32+
LibTest/typed_data/ByteData/setUint64_A01_t01: SkipByDesign # 64-bit int not supported on the web
33+
LibTest/typed_data/ByteData/setUint64_A02_t01: SkipByDesign # 64-bit int not supported on the web
34+
LibTest/typed_data/ByteData/setUint64_A02_t02: SkipByDesign # 64-bit int not supported on the web
35+
LibTest/typed_data/Int64List/*: SkipByDesign # Int64List not supported on the web
36+
LibTest/typed_data/Uint64List/*: SkipByDesign # Uint64List not supported on the web
1737

1838
[ $compiler == dart2js && $runtime == d8 ]
1939
LibTest/html/*: SkipByDesign # d8 is not a browser

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 15
2929
PATCH 0
30-
PRERELEASE 17
30+
PRERELEASE 18
3131
PRERELEASE_PATCH 0

tools/dom/PRESUBMIT.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)