Skip to content

Commit

Permalink
Use correct indenting and add trailing commas
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Googler authored and laszlocsomor committed Jul 28, 2015
1 parent b689cc3 commit 6976e6c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions site/docs/skylark/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ the attributes and their type when you define a rule.

```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(),
},
)
```

Expand Down Expand Up @@ -59,8 +59,8 @@ def impl(ctx):
)

my_rule = rule(
implementation=impl,
...
implementation=impl,
...
)
```

Expand All @@ -85,12 +85,12 @@ attribute where `x` is declared:

```python
my_rule(
name = "x"
name = "x",
)

my_rule(
name = "y",
deps = [":x"]
deps = [":x"],
)
```

Expand All @@ -103,11 +103,11 @@ def impl(ctx):
...

my_rule = rule(
implementation=impl,
attrs = {
"deps": attr.label_list()
}
...
implementation=impl,
attrs = {
"deps": attr.label_list(),
},
...
)
```

Expand Down Expand Up @@ -294,12 +294,12 @@ def rule_implementation(ctx):

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.
Expand Down

0 comments on commit 6976e6c

Please sign in to comment.