buildtools
buildtools copied to clipboard
Buildozer new command: copy rule
I'd like a buildozer command that copies a rule. Right now buildozer has copy <attr> <from_rule>
to copy attribute values, and new <rule_kind> <rule_name>
to make a new rule, but I would like:
- a new command
copy_rule <from_rule> <rule_name>
- or perhaps a new arg on
new
:new <rule_kind> <rule_name> [based_on <from_rule>]
This can only be achieved today using scary usage of things like print rule
or print startline
and print endline
combined with sed
or something... :fearful: some other tricky scripting.
buildozer 'copy_rule //a:b' //b:c //d:e ...
SGTM -- are you able to send a PR?
@pmbethe09 I came across this issue a few days back and ended up using print rule
for my use case. I think copy_rule
would be useful, and I can put up a PR for buildozer 'copy_rule //a:b' //b:c //d:e ...
; however, I wanted to check in first that this is still desirable since it's been a few years.
Is this something that might see the light of day? Or is it too stale to be resurrected?