diff options
author | Googler <noreply@google.com> | 2015-07-27 17:25:00 +0000 |
---|---|---|
committer | Laszlo Csomor <laszlocsomor@google.com> | 2015-07-28 07:52:14 +0000 |
commit | 6976e6c57657177cc9588144231e2958e9d9a97c (patch) | |
tree | 32826a8b7b1d1c135f602cf71a83d62a96a7ee73 | |
parent | b689cc3ebcf9031780f7fc644317b7335f232ed1 (diff) |
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
-rw-r--r-- | site/docs/skylark/rules.md | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md index 8338e6e69e..7616f34179 100644 --- a/site/docs/skylark/rules.md +++ b/site/docs/skylark/rules.md @@ -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(), + }, ) ``` @@ -59,8 +59,8 @@ def impl(ctx): ) my_rule = rule( - implementation=impl, - ... + implementation=impl, + ... ) ``` @@ -85,12 +85,12 @@ attribute where `x` is declared: ```python my_rule( - name = "x" + name = "x", ) my_rule( name = "y", - deps = [":x"] + deps = [":x"], ) ``` @@ -103,11 +103,11 @@ def impl(ctx): ... my_rule = rule( - implementation=impl, - attrs = { - "deps": attr.label_list() - } - ... + implementation=impl, + attrs = { + "deps": attr.label_list(), + }, + ... ) ``` @@ -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. |