Add ShortenAbsoluteLabelsToRelative configuration option#3492
Add ShortenAbsoluteLabelsToRelative configuration option#3492hartblanc wants to merge 2 commits into
Conversation
|
After pondering about please-build/puku#147, I'm actually wondering if we want to make The approach of gofmt for example, is to not allow any configuration and 'Gofmt's style is no one's favorite, yet gofmt is everyone's favorite.'. This works very nicely for tools which modify go source code, as they are able to always produce well-formatted output by simply calling gofmt (as a library). For this reason, whilst it seems a little crude at first, I'm wondering if please-build/buildtools#10 might actually be preferable to this approach. |
toastwaffle
left a comment
There was a problem hiding this comment.
Please could you fix the lint (otherwise this is good to go)
I tend to agree with this. It might be initially disruptive having this reformat but it seems nicer in the long run to have one canonical format than many with lots of flags. FWIW I don't think we have to change the library in the PR you mentioned; the approach here of calling |
My thinking was that it would be preferable to have other tools that format build rules via |
This change ensures that absolute labels to package-local targets (e.g.
//a/b/c:d) are transformed into local labels (e.g.:d) by the please format command when the newFormat.ShortenAbsoluteLabelsToRelativeconfig option is enabled.The aim of this change is to address #3471.
This change supercedes please-build/buildtools#10.