Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: PRESUBMIT.py

Issue 3005843002: Change presumbit to not provide unix-specific syntax on Windows. (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 """Top-level presubmit script for Dart. 5 """Top-level presubmit script for Dart.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into gcl. 8 for more details about the presubmit API built into gcl.
9 """ 9 """
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 # added for this CL. 79 # added for this CL.
80 old_version_has_errors = False 80 old_version_has_errors = False
81 81
82 if old_version_has_errors: 82 if old_version_has_errors:
83 print("WARNING: %s has existing and possibly new dartfmt issues" % 83 print("WARNING: %s has existing and possibly new dartfmt issues" %
84 git_file.LocalPath()) 84 git_file.LocalPath())
85 else: 85 else:
86 unformatted_files.append(filename) 86 unformatted_files.append(filename)
87 87
88 if unformatted_files: 88 if unformatted_files:
89 lineSep = ' \\\n'
90 if windows:
91 lineSep = ' ^\n'
89 return [output_api.PresubmitError( 92 return [output_api.PresubmitError(
90 'File output does not match dartfmt.\n' 93 'File output does not match dartfmt.\n'
91 'Fix these issues with:\n' 94 'Fix these issues with:\n'
92 '%s -w \\\n%s' % (prebuilt_dartfmt, ' \\\n'.join(unformatted_files)))] 95 '%s -w%s%s' % (prebuilt_dartfmt, lineSep,
96 lineSep.join(unformatted_files)))]
93 97
94 return [] 98 return []
95 99
96 def _CheckNewTests(input_api, output_api): 100 def _CheckNewTests(input_api, output_api):
97 testsDirectories = [ 101 testsDirectories = [
98 # Dart 1 tests DDC tests 102 # Dart 1 tests DDC tests
99 # ================= ========================== 103 # ================= ==========================
100 ("tests/language/", "tests/language_2/"), 104 ("tests/language/", "tests/language_2/"),
101 ("tests/corelib/", "tests/corelib_2/"), 105 ("tests/corelib/", "tests/corelib_2/"),
102 ("tests/lib/", "tests/lib_2/"), 106 ("tests/lib/", "tests/lib_2/"),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return result 168 return result
165 169
166 def CheckChangeOnCommit(input_api, output_api): 170 def CheckChangeOnCommit(input_api, output_api):
167 return (_CheckBuildStatus(input_api, output_api) + 171 return (_CheckBuildStatus(input_api, output_api) +
168 _CheckNewTests(input_api, output_api) + 172 _CheckNewTests(input_api, output_api) +
169 _CheckDartFormat(input_api, output_api)) 173 _CheckDartFormat(input_api, output_api))
170 174
171 def CheckChangeOnUpload(input_api, output_api): 175 def CheckChangeOnUpload(input_api, output_api):
172 return (_CheckNewTests(input_api, output_api) + 176 return (_CheckNewTests(input_api, output_api) +
173 _CheckDartFormat(input_api, output_api)) 177 _CheckDartFormat(input_api, output_api))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698