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

Unified Diff: mojo/dart/tools/presubmit/check_mojom_dart.py

Issue 1834893002: Treat empty string DartPackage as no DartPackage specified (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/mojom_dart_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/tools/presubmit/check_mojom_dart.py
diff --git a/mojo/dart/tools/presubmit/check_mojom_dart.py b/mojo/dart/tools/presubmit/check_mojom_dart.py
index 0f2f4164eab5a51fac8a8ec3d2a276223333839c..1c1ee4c08ece31cda96a2d2b37ad3d7c2759cadf 100755
--- a/mojo/dart/tools/presubmit/check_mojom_dart.py
+++ b/mojo/dart/tools/presubmit/check_mojom_dart.py
@@ -56,7 +56,13 @@ def _mojom_output_path(mojom):
# Given a mojom.Module, return the package or None.
def _mojom_package(mojom):
if mojom.attributes:
- return mojom.attributes.get('DartPackage')
+ package = mojom.attributes.get('DartPackage')
+ if package == None:
+ return package
+ package = package.strip()
+ if package == '':
+ return None
+ return package
# Load and parse a .mojom file. Returns the mojom.Module or raises an Exception
# if there was an error.
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/mojom_dart_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698