From 6976e6c57657177cc9588144231e2958e9d9a97c Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 27 Jul 2015 17:25:00 +0000 Subject: [PATCH] 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 --- site/docs/skylark/rules.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md index 8338e6e69ed7b8..7616f34179a71b 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.