Skip to content

Restrict the kind query to start anchor#1388

Open
fzakaria wants to merge 1 commit intobazelbuild:mainfrom
fzakaria:fzakaria/make-regex-look-for-start
Open

Restrict the kind query to start anchor#1388
fzakaria wants to merge 1 commit intobazelbuild:mainfrom
fzakaria:fzakaria/make-regex-look-for-start

Conversation

@fzakaria
Copy link
Copy Markdown
Contributor

We had rules such as pkg_java_library that were being caught by the kind pattern.

Force the prefix kind (i.e. java_) to anchor to the start of the label.

We had rules such as `pkg_java_library` that were being caught by the
kind pattern.

Force the prefix kind (i.e. java_) to anchor to the start of the label.
queryCmd = append(queryCmd, blazeFlags...)
queryCmd = append(
queryCmd, fmt.Sprintf("kind('(kt|java|android)_*', %s)", strings.Join(targetPatterns, " + ")))
queryCmd, fmt.Sprintf("kind('^(kt|java|android)_*', %s)", strings.Join(targetPatterns, " + ")))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should the line 365 be updated as well? To match the real command.

Would be nice to have tests as well, but it seems that this file is not covered by any tests =/ Therefore, this is a non-blocking wish.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the log message?
It's probably fine as is tbh.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe.. I'd keep everything aligned, but this doesn't really affect user experience.

@AnnaSvalova AnnaSvalova enabled auto-merge (squash) November 7, 2025 09:22
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.

3 participants