Use correct indenting and add trailing commas
Rules need 4 space indenting:
C0330: xx: Wrong hanging indentation (add 2 spaces).
Some rule instantiations are missing trailing commas. For others
commas are optional, but I think it's better to have them so entries
can be added or moved around more easily.
--
MOS_MIGRATED_REVID=99192101
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index 8338e6e..7616f34 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -17,11 +17,11 @@
```python
sum = rule(
- implementation=impl,
- attrs = {
- "number": attr.int(default = 1),
- "deps": attr.label_list(),
- },
+ implementation=impl,
+ attrs = {
+ "number": attr.int(default = 1),
+ "deps": attr.label_list(),
+ },
)
```
@@ -59,8 +59,8 @@
)
my_rule = rule(
- implementation=impl,
- ...
+ implementation=impl,
+ ...
)
```
@@ -85,12 +85,12 @@
```python
my_rule(
- name = "x"
+ name = "x",
)
my_rule(
name = "y",
- deps = [":x"]
+ deps = [":x"],
)
```
@@ -103,11 +103,11 @@
...
my_rule = rule(
- implementation=impl,
- attrs = {
- "deps": attr.label_list()
- }
- ...
+ implementation=impl,
+ attrs = {
+ "deps": attr.label_list(),
+ },
+ ...
)
```
@@ -294,12 +294,12 @@
runfiles = ctx.runfiles(
# Add some files manually.
- files = [ctx.file.some_data_file]
+ files = [ctx.file.some_data_file],
# Add transitive files from dependencies manually.
- transitive_files = transitive_runfiles
+ transitive_files = transitive_runfiles,
# Collect runfiles from the common locations: transitively from srcs,
# deps and data attributes.
- collect_default = True
+ collect_default = True,
)
# Add a field named "runfiles" to the return struct in order to actually
# create the symlink tree.