aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar vladmos <vladmos@google.com>2017-12-14 11:38:17 -0500
committerGravatar John Cater <jcater@google.com>2017-12-14 12:38:41 -0500
commit1419d64c7549d26a8a111485072d2411dc3a5a85 (patch)
tree441e9939f1194122b0f2c1f62fcec06c23186147 /site
parent69c45f8e37e021c6668b8be12eb44ad132292186 (diff)
Replace `ctx.config` with `ctx.configuration` in the documentation
PiperOrigin-RevId: 179048579
Diffstat (limited to 'site')
-rw-r--r--site/docs/skylark/rules.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index 3d58b330da..7b87852733 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -557,7 +557,7 @@ def _rule_implementation(ctx):
dependency_attributes = ["data", "deps"]))
```
-[ctx.config.coverage_enabled](lib/configuration.html#coverage_enabled) notes
+[ctx.configuration.coverage_enabled](lib/configuration.html#coverage_enabled) notes
whether coverage data collection is enabled for the current run in general
(but says nothing about which files specifically should be instrumented).
If a rule implementation needs to add coverage instrumentation at
@@ -570,19 +570,19 @@ if ctx.coverage_instrumented():
# Do something to turn on coverage for this compile action
```
-Note that function will always return false if `ctx.config.coverage_enabled` is
+Note that function will always return false if `ctx.configuration.coverage_enabled` is
false, so you don't need to check both.
If the rule directly includes sources from its dependencies before compilation
(e.g. header files), it may also need to turn on compile-time instrumentation
if the dependencies' sources should be instrumented. In this case, it may
-also be worth checking `ctx.config.coverage_enabled` so you can avoid looping
+also be worth checking `ctx.configuration.coverage_enabled` so you can avoid looping
over dependencies unnecessarily:
```python
# Are this rule's sources or any of the sources for its direct dependencies
# in deps instrumented?
-if ctx.config.coverage_enabled:
+if ctx.configuration.coverage_enabled:
if (ctx.coverage_instrumented() or
any(ctx.coverage_instrumented(dep) for dep in ctx.attr.deps):
# Do something to turn on coverage for this compile action