bazelbuild / buildtools

A bazel BUILD file formatter and editor
Apache License 2.0
1.01k stars 415 forks source link

buildozer: correctly substitute custom string attrs #1246

Closed thumphries-stripe closed 5 months ago

thumphries-stripe commented 7 months ago

getAttrValueExpr runs via the TypeOf map, and encodes the value as an ident if the type is not known. This works correctly for known attributes, but produces an invalid result for anything not contained in that map.

However, we already know the attribute is a string due to the type assertion on L543, and can construct it directly.

google-cla[bot] commented 7 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.