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

Unified Diff: tools/metrics/histograms/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 | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/print_style.py
diff --git a/tools/metrics/histograms/print_style.py b/tools/metrics/histograms/print_style.py
index 6b7064990c6141bb812ef69f4b3361a0c8ac26ca..4e5efa1ffc8d61514dacb49e69b6b3e9f0557c49 100644
--- a/tools/metrics/histograms/print_style.py
+++ b/tools/metrics/histograms/print_style.py
@@ -32,6 +32,15 @@ ATTRIBUTE_ORDER = {
'with-suffix': ['name'],
}
+# Attribute names that must be explicitly specified on nodes that support them.
+REQUIRED_ATTRIBUTES = [
+ # TODO(isherman): Make the 'label' attribute required as well. This requires
+ # fixing up existing suffixes that omit a label.
+ 'name',
+ 'separator',
+ 'value',
+]
+
# Tag names for top-level nodes whose children we don't want to indent.
TAGS_THAT_DONT_INDENT = [
'histogram-configuration',
@@ -72,6 +81,7 @@ TAGS_ALPHABETIZATION_RULES = {
def GetPrintStyle():
"""Returns an XmlStyle object for pretty printing histograms."""
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 | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698