@@ -82,7 +82,7 @@ def _get_clippy_ready_crate_info(target, aspect_ctx = None):
82
82
def _clippy_aspect_impl (target , ctx ):
83
83
crate_info = _get_clippy_ready_crate_info (target , ctx )
84
84
if not crate_info :
85
- return [ClippyInfo (output = depset ([] ))]
85
+ return [ClippyInfo (output = depset ())]
86
86
87
87
toolchain = find_toolchain (ctx )
88
88
cc_toolchain , feature_configuration = find_cc_toolchain (ctx )
@@ -181,14 +181,12 @@ See https://github.com/bazelbuild/rules_rust/pull/1264#discussion_r853241339 for
181
181
)
182
182
183
183
return [
184
- OutputGroupInfo (clippy_checks = depset ([clippy_out ])),
184
+ OutputGroupInfo (_validation = depset ([clippy_out ])),
185
185
ClippyInfo (output = depset ([clippy_out ])),
186
186
]
187
187
188
188
# Example: Run the clippy checker on all targets in the codebase.
189
- # bazel build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect \
190
- # --output_groups=clippy_checks \
191
- # //...
189
+ # bazel build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect //...
192
190
rust_clippy_aspect = aspect (
193
191
fragments = ["cpp" ],
194
192
host_fragments = ["cpp" ],
@@ -266,15 +264,14 @@ rust_test(
266
264
Then the targets can be analyzed with clippy using the following command:
267
265
268
266
```output
269
- $ bazel build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect \
270
- --output_groups=clippy_checks //hello_lib:all
267
+ $ bazel build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect //hello_lib:all
271
268
```
272
269
""" ,
273
270
)
274
271
275
272
def _rust_clippy_rule_impl (ctx ):
276
- clippy_ready_targets = [dep for dep in ctx .attr .deps if "clippy_checks" in dir ( dep [OutputGroupInfo ]) ]
277
- files = depset ([], transitive = [dep [OutputGroupInfo ].clippy_checks for dep in clippy_ready_targets ])
273
+ clippy_ready_targets = [dep for dep in ctx .attr .deps if ClippyInfo in dep [OutputGroupInfo ]]
274
+ files = depset ([], transitive = [dep [OutputGroupInfo ]._validation for dep in clippy_ready_targets ])
278
275
return [DefaultInfo (files = files )]
279
276
280
277
rust_clippy = rule (
0 commit comments