buildtools icon indicating copy to clipboard operation
buildtools copied to clipboard

Does buildifier support removing empty sections?

Open pelikan-b opened this issue 3 years ago • 1 comments

Does buildifier support removing empty sections?

For example

my_rule(
  name = "foo",
  deps = [
  ],
)

I would like to have deps removed.

Thanks!

pelikan-b avatar Aug 26 '22 21:08 pelikan-b

No, it's not safe in the general case. It can modify the program execution (depending on the default value of the argument).

If you find this kind of cleanup useful, we could have a command in buildozer (remove_if_empty?).

laurentlb avatar Aug 27 '22 20:08 laurentlb