buildtools icon indicating copy to clipboard operation
buildtools copied to clipboard

Buildozer new command: copy rule

Open srawlins opened this issue 6 years ago • 3 comments

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.

srawlins avatar Aug 30 '17 16:08 srawlins

buildozer 'copy_rule //a:b' //b:c //d:e ...

SGTM -- are you able to send a PR?

pmbethe09 avatar Oct 02 '17 14:10 pmbethe09

@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.

jmcrawford45 avatar Jul 29 '22 23:07 jmcrawford45

Is this something that might see the light of day? Or is it too stale to be resurrected?

rossc719g avatar Jun 20 '23 18:06 rossc719g