Create and example of how to change the default on inherited attributes
I found it confusing how to create a test rule with a different default size and had to dig through a lot of example code to figure this out. This pull request adds and example to the docs.
Closes #3233.
PiperOrigin-RevId: 160276727
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index 0b15b98..9c47acf 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -591,6 +591,16 @@
`ctx.outputs.executable`.
Test rules inherit the following attributes: `args`, `flaky`, `local`,
-`shard_count`, `size`, `timeout`.
+`shard_count`, `size`, `timeout`. The defaults of inherited attributes cannot be
+changed, but you can use a macro with default arguments:
+
+```python
+def example_test(size="small", **kwargs):
+ _example_test(size=size, **kwargs)
+
+_example_test = rule(
+ ...
+)
+```
[1]: https://www.python.org/dev/peps/pep-0008/#id46