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

Merger.Merge should return an error #1929

Open ashi009 opened 3 weeks ago

ashi009 commented 3 weeks ago

What version of gazelle are you using?

0.38.0

What version of rules_go are you using?

N/A

What version of Bazel are you using?

7.1.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

N/A

What did you do?

When implementing Merger, there is no way to return merge errors.

However, the mergeAttrValues function supports error handling.

https://github.com/bazelbuild/bazel-gazelle/blob/571d953b2bb9534c145242ead08eb35b3b096a5e/rule/merge.go#L100

It would be nice to return an error along the merged expr.

What did you expect to see?

What did you see instead?