diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java index 0bdc1f1f3f..769c010967 100644 --- a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java +++ b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java @@ -40,12 +40,14 @@ class RuleDocumentationAttribute implements Comparable<RuleDocumentationAttribut private static final Map<Type<?>, String> TYPE_DESC = ImmutableMap.<Type<?>, String>builder() .put(Type.BOOLEAN, "Boolean") .put(Type.INTEGER, "Integer") - .put(Type.INTEGER_LIST, "List of Integer") + .put(Type.INTEGER_LIST, "List of integers") .put(Type.STRING, "String") - .put(Type.STRING_LIST, "List of String") + .put(Type.STRING_LIST, "List of strings") .put(Type.TRISTATE, "Integer") .put(Type.LABEL, "<a href=\"build-ref.html#labels\">Label</a>") .put(Type.LABEL_LIST, "List of <a href=\"build-ref.html#labels\">labels</a>") + .put(Type.LABEL_LIST_DICT, + "Dictionary mapping strings to lists of <a href=\"build-ref.html#labels\">labels</a>") .put(Type.NODEP_LABEL, "<a href=\"build-ref.html#name\">Name</a>") .put(Type.NODEP_LABEL_LIST, "List of <a href=\"build-ref.html#name\">names</a>") .put(Type.OUTPUT, "<a href=\"build-ref.html#filename\">Filename</a>") @@ -102,7 +104,7 @@ class RuleDocumentationAttribute implements Comparable<RuleDocumentationAttribut /** * Returns the raw html documentation of the rule attribute. */ - String getHtmlDocumentation(Attribute attribute) { + String getHtmlDocumentation(Attribute attribute, String ruleName) { // TODO(bazel-team): this is needed for common type attributes. Fix those and remove this. if (attribute == null) { return htmlDocumentation; @@ -113,7 +115,11 @@ class RuleDocumentationAttribute implements Comparable<RuleDocumentationAttribut .append("; " + (attribute.isMandatory() ? "required" : "optional")) .append(getDefaultValue(attribute)) .append(")</i><br/>\n"); - return htmlDocumentation.replace("${" + DocgenConsts.VAR_SYNOPSIS + "}", sb.toString()); + String synposisVar = "${" + DocgenConsts.VAR_SYNOPSIS + "}"; + if (!flags.contains(DocgenConsts.FLAG_DEPRECATED) && !htmlDocumentation.contains(synposisVar)) { + System.err.println("WARNING: No synopsis found for " + ruleName + "." + attributeName); + } + return htmlDocumentation.replace(synposisVar, sb.toString()); } private String getDefaultValue(Attribute attribute) { |