bazelbuild/bazel-gazelle

merger: support dict attributes

iffyio opened this issue · 0 comments

What version of gazelle are you using?

0.20.0

What version of rules_go are you using?

0.24.2

What version of Bazel are you using?

1.4.0

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

Yes

What operating system and processor architecture are you using?

Linux x86

What did you do?

I was writing a Gazelle extension and looking to update a rule which has a string_dict attribute. From what I can tell, Gazelle doesn't support merging plain key-value pairs? so that setting a map attribute panics

myrule.SetAttr('a', map[string]string { "k": "v" })

Is this use case maybe not supposed to be supported (I could see a mergeDict which seemed to only be used for selects at the moment)? is there a workaround for this? e.g a way to replace the attribute rather than merge?

What did you expect to see?

An expression in myrule with attribute a = { "k": "v" }

What did you see instead?

// gazelle: type not supported:
// panic: type not supported: