Update aspects.md
Minor doc edits
Closes
@@ -170,7 +170,7 @@ that counts files in targets, potentially filtering them by extension.
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 @@ def _file_count_aspect_impl(target, ctx):
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 @@ file_count_rule = rule(
)
```
-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 @@ file_count_rule(
### 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 @@ Aspects are also allowed to have private attributes of types ``label`` or
``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 @@ restrictions placed on the parameter in the aspect definition.
### 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',
