@@ -219,7 +219,7 @@ public static String markdownCodeSpan(String code) {
219219 public String ruleSummary (String ruleName , RuleInfo ruleInfo ) {
220220 ImmutableList <String > attributeNames =
221221 ruleInfo .getAttributeList ().stream ().map (AttributeInfo ::getName ).collect (toImmutableList ());
222- return maybeLoad ( ruleName ) + summary (ruleName , attributeNames );
222+ return summary (ruleName , attributeNames );
223223 }
224224
225225 /**
@@ -233,7 +233,7 @@ public String providerSummary(String providerName, ProviderInfo providerInfo) {
233233 providerInfo .getFieldInfoList ().stream ()
234234 .map (StardocOutputProtos .ProviderFieldInfo ::getName )
235235 .collect (toImmutableList ());
236- return maybeLoad ( providerName ) + summary (providerName , fieldNames );
236+ return summary (providerName , fieldNames );
237237 }
238238
239239 /**
@@ -247,16 +247,7 @@ public String aspectSummary(String aspectName, AspectInfo aspectInfo) {
247247 aspectInfo .getAttributeList ().stream ()
248248 .map (AttributeInfo ::getName )
249249 .collect (toImmutableList ());
250- String aspectFlag =
251- entrypointBzlFile
252- // Namespaced aspects can't be referenced on the command line.
253- .filter (unused -> !aspectName .contains ("." ))
254- .map (
255- file ->
256- String .format (
257- "# or on the command line:\n # --aspects=%s%%%s\n " , file , aspectName ))
258- .orElse ("" );
259- return maybeLoad (aspectName ) + aspectFlag + summary (aspectName , attributeNames );
250+ return summary (aspectName , attributeNames );
260251 }
261252
262253 /**
@@ -270,7 +261,7 @@ public String aspectSummary(String aspectName, AspectInfo aspectInfo) {
270261 public String repositoryRuleSummary (String ruleName , RepositoryRuleInfo ruleInfo ) {
271262 ImmutableList <String > attributeNames =
272263 ruleInfo .getAttributeList ().stream ().map (AttributeInfo ::getName ).collect (toImmutableList ());
273- return maybeLoad ( ruleName ) + summary (ruleName , attributeNames );
264+ return summary (ruleName , attributeNames );
274265 }
275266
276267 /**
@@ -319,12 +310,13 @@ public String funcSummary(StarlarkFunctionInfo funcInfo) {
319310 funcInfo .getParameterList ().stream ()
320311 .map (FunctionParamInfo ::getName )
321312 .collect (toImmutableList ());
322- return maybeLoad ( funcInfo . getFunctionName ()) + summary (funcInfo .getFunctionName (), paramNames );
313+ return summary (funcInfo .getFunctionName (), paramNames );
323314 }
324315
325- private String maybeLoad (String name ) {
316+ @ SuppressWarnings ("unused" ) // Used by markdown template.
317+ public String loadStatement (String name ) {
326318 return entrypointBzlFile
327- .map (file -> String .format ("load(\" %s\" , \" %s\" )\n " , file , name .split ("\\ ." )[0 ]))
319+ .map (file -> String .format ("load(\" %s\" , \" %s\" )" , file , name .split ("\\ ." )[0 ]))
328320 .orElse ("" );
329321 }
330322
0 commit comments