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.21k stars 381 forks source link

revert #1873 #1897

Closed tyler-french closed 2 months ago

tyler-french commented 3 months ago

We need access to rule.Name() as well as rule.Kind() in mapped resolver.

fmeum commented 2 months ago

@jbedard We need to roll this change back as it breaks the public resolver API, which has a legitimate need to access other rule fields. Do you see a way to reland the desired behavior without touching public API?

jbedard commented 2 months ago

I'll look at it again if we must revert it.

Is this actually a publicly documented API though?

tyler-french commented 2 months ago

I'll look at it again if we must revert it.

Is this actually a publicly documented API though?

https://pkg.go.dev/github.com/bazelbuild/bazel-gazelle@v0.38.0/resolve#NewRuleIndex