Skip to content

add query cmds and aspects#5

Open
juiwenchen wants to merge 2 commits into
mainfrom
test-query-aspects
Open

add query cmds and aspects#5
juiwenchen wants to merge 2 commits into
mainfrom
test-query-aspects

Conversation

@juiwenchen
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings October 8, 2025 11:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_analyse targets 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.

Comment thread print.bzl
# Reference: https://bazel.build/extending/aspects

def _print_aspect_impl(target, ctx):

Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary blank line for cleaner code formatting.

Suggested change

Copilot uses AI. Check for mistakes.
Comment thread print.bzl
attr_aspects = ['srcs'], # the edge to track
attrs = {
'target_kind': attr.string(
default = 'codelinks_analyse',),
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing comma after the closing parenthesis - it's not needed when there are no additional parameters.

Suggested change
default = 'codelinks_analyse',),
default = 'codelinks_analyse'),

Copilot uses AI. Check for mistakes.
Comment thread inspections.rst Outdated
Comment on lines +1 to +4
## Experiments with Bazel queries and aspects to inspect targets



Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use proper reStructuredText heading syntax with underlines instead of Markdown-style ## headers.

Suggested change
## Experiments with Bazel queries and aspects to inspect targets
Experiments with Bazel queries and aspects to inspect targets
============================================================

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants