bazel-contrib / bazel-gazelle

Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Apache License 2.0
1.19k stars 378 forks source link

Preserve canonical labels as such #1863

Closed fmeum closed 1 month ago

fmeum commented 2 months ago

What type of PR is this?

Bug fix

What package or component does this PR mostly affect?

label

What does this PR do? Why is it needed?

Previously, parsing and then stringifying a label would turn @@canonical~name//pkg:target into @canonical~name//pkg:target, which is no longer valid.

The new field on Label defaults to false if not set, which preserves the current behavior.

Which issues(s) does this PR fix?

Fixes #1862

Other notes for review