bazelbuild / buildtools

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

buildifier: fix uninitialised check when using list unpack assignment #1202

Closed Gandem closed 12 months ago

Gandem commented 1 year ago

Fixes https://github.com/bazelbuild/buildtools/issues/1201

As the test added in this commit shows, prior to this commit, the uninitialized check would incorrectly fail when using list unpack assignment, if the same variable is reused later.

This modifies CollectLValues, so that it supports list unpack assignments (in addition to tuple, and normal assignments).

Please let me know if there's anything that needs to be added/modified in this change, thanks! 🙏

vladmos commented 12 months ago

Could you please update the branch? Usually I can do this myself just before merging, but now I likely don't have permissions to do so.

Gandem commented 12 months ago

@vladmos Done, thanks 🙇 !