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

Side by Side Diff: mojo/dart/tools/presubmit/check_mojom_dart.py

Issue 1545483003: Dart: Reorganize files (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix build file Created 5 years 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 | « mojo/dart/test/validation_test.dart ('k') | mojo/dart/unittests/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Checks that released mojom.dart files in the source tree are up to date""" 6 """Checks that released mojom.dart files in the source tree are up to date"""
7 7
8 import argparse 8 import argparse
9 import os 9 import os
10 import subprocess 10 import subprocess
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 updated_mojom_dart_files = [] 315 updated_mojom_dart_files = []
316 packages_with_failures = [] 316 packages_with_failures = []
317 check_failure = False 317 check_failure = False
318 318
319 # Check for updated .mojom without updated .mojom.dart 319 # Check for updated .mojom without updated .mojom.dart
320 for mojom_file in mojoms: 320 for mojom_file in mojoms:
321 try: 321 try:
322 mojom = _load_mojom(mojom_file) 322 mojom = _load_mojom(mojom_file)
323 except Exception: 323 except Exception:
324 # Could not load .mojom file 324 # Could not load .mojom file
325 print("Could not load mojom file: %s" % mojom_file)
325 return True 326 return True
326 327
327 package = _mojom_package(mojom) 328 package = _mojom_package(mojom)
328 # If a mojom doesn't have a package, ignore it. 329 # If a mojom doesn't have a package, ignore it.
329 if not package: 330 if not package:
330 continue 331 continue
331 package_dir = packages.get(package) 332 package_dir = packages.get(package)
332 # If the package isn't a known package, ignore it. 333 # If the package isn't a known package, ignore it.
333 if not package_dir: 334 if not package_dir:
334 continue 335 continue
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 if args.affected_files: 402 if args.affected_files:
402 check_failure = presubmit_check(packages, args.affected_files) 403 check_failure = presubmit_check(packages, args.affected_files)
403 else: 404 else:
404 check_failure = global_check(packages) 405 check_failure = global_check(packages)
405 if check_failure: 406 if check_failure:
406 return 2 407 return 2
407 return 0 408 return 0
408 409
409 if __name__ == '__main__': 410 if __name__ == '__main__':
410 sys.exit(main()) 411 sys.exit(main())
OLDNEW
« no previous file with comments | « mojo/dart/test/validation_test.dart ('k') | mojo/dart/unittests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698