Update aspects.md Minor doc edits Closes #13356. PiperOrigin-RevId: 368606094
diff --git a/site/docs/skylark/aspects.md b/site/docs/skylark/aspects.md index 2e4db44..29c0b73 100644 --- a/site/docs/skylark/aspects.md +++ b/site/docs/skylark/aspects.md
@@ -170,7 +170,7 @@ It shows how to use a provider to return values, how to use parameters to pass an argument into an aspect implementation, and how to invoke an aspect from a rule. -FileCount.bzl file: +`file_count.bzl` file: ```python FileCountInfo = provider( @@ -193,7 +193,8 @@ count = count + dep[FileCountInfo].count return [FileCountInfo(count = count)] -file_count_aspect = aspect(implementation = _file_count_aspect_impl, +file_count_aspect = aspect( + implementation = _file_count_aspect_impl, attr_aspects = ['deps'], attrs = { 'extension' : attr.string(values = ['*', 'h', 'cc']), @@ -213,10 +214,10 @@ ) ``` -BUILD.bazel file: +`BUILD.bazel` file: ```python -load('//file_count.bzl', 'file_count_rule') +load('//:file_count.bzl', 'file_count_rule') cc_library( name = 'lib', @@ -246,7 +247,8 @@ ### Aspect definition ```python -file_count_aspect = aspect(implementation = _file_count_aspect_impl, +file_count_aspect = aspect( + implementation = _file_count_aspect_impl, attr_aspects = ['deps'], attrs = { 'extension' : attr.string(values = ['*', 'h', 'cc']), @@ -270,7 +272,7 @@ ``label_list``. Private label attributes can be used to specify dependencies on tools or libraries that are needed for actions generated by aspects. There is not a private attribute defined in this example, but the following code snippet -demonstrates how you could pass in a tool to a aspect: +demonstrates how you could pass in a tool to an aspect: ```python ... @@ -364,7 +366,7 @@ ### Invoking an aspect through a target rule ```python -load('//file_count.bzl', 'file_count_rule') +load('//:file_count.bzl', 'file_count_rule') cc_binary( name = 'app',