Skip to content

Commit

Permalink
Skydoc: do not show documentation of loaded symbols
Browse files Browse the repository at this point in the history
Default behavior of Bazel will change soon (--incompatible_no_transitive_loads)

#5636

RELNOTES: None.
PiperOrigin-RevId: 222841756
  • Loading branch information
laurentlb authored and Copybara-Service committed Nov 26, 2018
1 parent 887a4cd commit e7ebb7e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public Environment eval(
ImmutableSet.Builder<RuleInfo> handledRuleDefinitions = ImmutableSet.builder();

// Sort the bindings so their ordering is deterministic.
TreeMap<String, Object> sortedBindings = new TreeMap<>(env.getGlobals().getBindings());
TreeMap<String, Object> sortedBindings = new TreeMap<>(env.getGlobals().getExportedBindings());

for (Entry<String, Object> envEntry : sortedBindings.entrySet()) {
if (ruleFunctions.containsKey(envEntry.getValue())) {
Expand Down
10 changes: 2 additions & 8 deletions src/test/java/com/google/devtools/build/skydoc/SkydocTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,8 @@ public void testRulesAcrossMultipleFiles() throws Exception {

Map<String, RuleInfo> ruleInfoMap = ruleInfoMapBuilder.build();

// dep_rule is available here, even though it was not defined in main.bzl, because it is
// imported in main.bzl. Thus, it's a top-level symbol in main.bzl.
assertThat(ruleInfoMap.keySet()).containsExactly("main_rule", "dep_rule");
assertThat(ruleInfoMap.keySet()).containsExactly("main_rule");
assertThat(ruleInfoMap.get("main_rule").getDocString()).isEqualTo("Main rule");
assertThat(ruleInfoMap.get("dep_rule").getDocString()).isEqualTo("Dep rule");
}

@Test
Expand Down Expand Up @@ -265,11 +262,8 @@ public void testRulesAcrossRepository() throws Exception {

Map<String, RuleInfo> ruleInfoMap = ruleInfoMapBuilder.build();

// dep_rule is available here, even though it was not defined in main.bzl, because it is
// imported in main.bzl. Thus, it's a top-level symbol in main.bzl.
assertThat(ruleInfoMap.keySet()).containsExactly("main_rule", "dep_rule");
assertThat(ruleInfoMap.keySet()).containsExactly("main_rule");
assertThat(ruleInfoMap.get("main_rule").getDocString()).isEqualTo("Main rule");
assertThat(ruleInfoMap.get("dep_rule").getDocString()).isEqualTo("Dep rule");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ shift 1
golden_file=$1
shift 1

DIFF="$(diff ${actual_file} ${golden_file})"
DIFF="$(diff -u ${actual_file} ${golden_file})"

if [ "$DIFF" != "" ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,79 +124,6 @@ This is yet another rule
</table>


## my_rule_impl

<pre>
my_rule_impl(<a href="#my_rule_impl-ctx">ctx</a>)
</pre>



### Parameters

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="my_rule_impl-ctx>
<td><code>ctx</code></td>
<td>
required.
</td>
</tr>
</tbody>
</table>


## some_cool_function

<pre>
some_cool_function(<a href="#some_cool_function-name">name</a>, <a href="#some_cool_function-srcs">srcs</a>, <a href="#some_cool_function-beef">beef</a>)
</pre>

A pretty cool function. You should call it.

### Parameters

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="some_cool_function-name>
<td><code>name</code></td>
<td>
required.
<p>
Some sort of name.
</p>
</td>
</tr>
<tr id="some_cool_function-srcs>
<td><code>srcs</code></td>
<td>
optional. default is <code>[]</code>
<p>
What sources you want cool stuff to happen to.
</p>
</td>
</tr>
<tr id="some_cool_function-beef>
<td><code>beef</code></td>
<td>
optional. default is <code>""</code>
<p>
Your opinion on beef.
</p>
</td>
</tr>
</tbody>
</table>


## top_fun

<pre>
Expand Down

0 comments on commit e7ebb7e

Please sign in to comment.