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

Unified Diff: tools/metrics/actions/print_style.py

Issue 2894833005: Make histogram_suffixes separators and enum labels required. (Closed)
Patch Set: Rebase, and improve the error reporting logic Created 3 years, 7 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 | tools/metrics/common/pretty_print_xml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/actions/print_style.py
diff --git a/tools/metrics/actions/print_style.py b/tools/metrics/actions/print_style.py
index 39deb2300e3984b679a2d74f3f8d78cfc2e4cee4..817b148ebb8fd5f971fb9e708f173bc528ea4c5c 100644
--- a/tools/metrics/actions/print_style.py
+++ b/tools/metrics/actions/print_style.py
@@ -27,6 +27,13 @@ ATTRIBUTE_ORDER = {
'with-suffix': ['name'],
}
+# Attribute names that must be explicitly specified on nodes that support them.
+REQUIRED_ATTRIBUTES = [
+ 'label',
+ 'name',
+ 'separator',
+]
+
# Tag names for top-level nodes whose children we don't want to indent.
TAGS_THAT_DONT_INDENT = [
'actions',
@@ -59,6 +66,7 @@ TAGS_ALPHABETIZATION_RULES = {
def GetPrintStyle():
"""Returns an XmlStyle object for pretty printing actions."""
return pretty_print_xml.XmlStyle(ATTRIBUTE_ORDER,
+ REQUIRED_ATTRIBUTES,
TAGS_THAT_HAVE_EXTRA_NEWLINE,
TAGS_THAT_DONT_INDENT,
TAGS_THAT_ALLOW_SINGLE_LINE,
« no previous file with comments | « no previous file | tools/metrics/common/pretty_print_xml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698