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

Side by Side Diff: PRESUBMIT.py

Issue 1449203002: Check in generated Dart bindings and add presubmit script (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | mojo/dart/packages/mojo/lib/mojo/application.mojom.dart » ('j') | 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 Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Top-level presubmit script for Chromium. 5 """Top-level presubmit script for Chromium.
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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 if f.LocalPath().endswith(('.h', '.c', '.cc', '.m', '.mm')): 1056 if f.LocalPath().endswith(('.h', '.c', '.cc', '.m', '.mm')):
1057 for lnum, line in f.ChangedContents(): 1057 for lnum, line in f.ChangedContents():
1058 # Disallow Foo(*my_scoped_thing.Pass()); See crbug.com/418297. 1058 # Disallow Foo(*my_scoped_thing.Pass()); See crbug.com/418297.
1059 if input_api.re.search(r'\*[a-zA-Z0-9_]+\.Pass\(\)', line): 1059 if input_api.re.search(r'\*[a-zA-Z0-9_]+\.Pass\(\)', line):
1060 errors.append(output_api.PresubmitError( 1060 errors.append(output_api.PresubmitError(
1061 ('%s:%d uses *foo.Pass() to delete the contents of scoped_ptr. ' + 1061 ('%s:%d uses *foo.Pass() to delete the contents of scoped_ptr. ' +
1062 'See crbug.com/418297.') % (f.LocalPath(), lnum))) 1062 'See crbug.com/418297.') % (f.LocalPath(), lnum)))
1063 return errors 1063 return errors
1064 1064
1065 1065
1066 def _CheckDartBindings(input_api, output_api):
1067 """Check that generated .mojom.dart files are current"""
1068 args = [input_api.python_executable,
1069 'mojo/dart/tools/presubmit/check_mojom_dart.py',
1070 '--affected-files']
1071 files = []
1072 for f in input_api.AffectedFiles():
1073 files.append(f.LocalPath())
1074 args.extend(files)
1075 try:
1076 input_api.subprocess.check_output(args)
1077 return []
1078 except input_api.subprocess.CalledProcessError, error:
1079 return [output_api.PresubmitError(
1080 'Dart bindings need to be updated.',
1081 long_text=error.output)]
1082
1083
1066 def CheckChangeOnUpload(input_api, output_api): 1084 def CheckChangeOnUpload(input_api, output_api):
1067 results = [] 1085 results = []
1068 results.extend(_CommonChecks(input_api, output_api)) 1086 results.extend(_CommonChecks(input_api, output_api))
1069 results.extend(_CheckValidHostsInDEPS(input_api, output_api)) 1087 results.extend(_CheckValidHostsInDEPS(input_api, output_api))
1070 results.extend(_CheckJavaStyle(input_api, output_api)) 1088 results.extend(_CheckJavaStyle(input_api, output_api))
1089 results.extend(_CheckDartBindings(input_api, output_api))
1071 results.extend( 1090 results.extend(
1072 input_api.canned_checks.CheckGNFormatted(input_api, output_api)) 1091 input_api.canned_checks.CheckGNFormatted(input_api, output_api))
1073 return results 1092 return results
1074 1093
1075 1094
1076 def GetDefaultTryConfigs(bots=None): 1095 def GetDefaultTryConfigs(bots=None):
1077 """Returns a list of ('bot', set(['tests']), optionally filtered by [bots]. 1096 """Returns a list of ('bot', set(['tests']), optionally filtered by [bots].
1078 1097
1079 If 'bots' is specified, will only return configurations for bots in that list. 1098 If 'bots' is specified, will only return configurations for bots in that list.
1080 """ 1099 """
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 'Mojo Linux ASan Try', 1147 'Mojo Linux ASan Try',
1129 'Mojo Linux Try', 1148 'Mojo Linux Try',
1130 ] 1149 ]
1131 1150
1132 return GetDefaultTryConfigs(builders) 1151 return GetDefaultTryConfigs(builders)
1133 1152
1134 def PostUploadHook(cl, change, output_api): 1153 def PostUploadHook(cl, change, output_api):
1135 import subprocess 1154 import subprocess
1136 subprocess.check_call(["git", "cl", "try"]) 1155 subprocess.check_call(["git", "cl", "try"])
1137 return [] 1156 return []
OLDNEW
« no previous file with comments | « no previous file | mojo/dart/packages/mojo/lib/mojo/application.mojom.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698