add query cmds and aspects#5
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds Bazel query commands and aspects for inspecting targets, specifically focusing on codelinks_analyse rule types. The changes provide tools to explore and analyze source files of Bazel targets through query commands and custom aspects.
- Implements a custom Bazel aspect to print target information and source file paths
- Adds documentation with example commands for querying and building targets with aspects
- Provides utilities for analyzing
codelinks_analysetargets across the repository
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| print.bzl | Implements a Bazel aspect to print target labels, kinds, and source file paths |
| inspections.rst | Documents query commands and aspect usage examples for target inspection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # Reference: https://bazel.build/extending/aspects | ||
|
|
||
| def _print_aspect_impl(target, ctx): | ||
|
|
There was a problem hiding this comment.
Remove unnecessary blank line for cleaner code formatting.
| attr_aspects = ['srcs'], # the edge to track | ||
| attrs = { | ||
| 'target_kind': attr.string( | ||
| default = 'codelinks_analyse',), |
There was a problem hiding this comment.
Remove trailing comma after the closing parenthesis - it's not needed when there are no additional parameters.
| default = 'codelinks_analyse',), | |
| default = 'codelinks_analyse'), |
| ## Experiments with Bazel queries and aspects to inspect targets | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Use proper reStructuredText heading syntax with underlines instead of Markdown-style ## headers.
| ## Experiments with Bazel queries and aspects to inspect targets | |
| Experiments with Bazel queries and aspects to inspect targets | |
| ============================================================ |
No description provided.