Skip to content

Enable ShortenAbsoluteLabelsToRelative flag#10

Closed
hartblanc wants to merge 1 commit intoplease-build:masterfrom
hartblanc:master
Closed

Enable ShortenAbsoluteLabelsToRelative flag#10
hartblanc wants to merge 1 commit intoplease-build:masterfrom
hartblanc:master

Conversation

@hartblanc
Copy link

This will ensure 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.

The aim of this change is ultimately to address thought-machine/please#3471

I have tested the change by adding a test case to github.com/thought-machine which tests the scenario described in the issue. I will raise a a PR with this test case when bumping the version of github.com/thought-machine/please-build/buildtools used by github.com/thought-machine/please.

This will ensure that absolute labels to package-local targets (e.g. //a/b/c:d) are transformed into local labels (e.g. :d) by please format.
@toastwaffle
Copy link

Rather than just enabling this globally, can we make it possible to enable this with a config flag in Please? That would probably involve introducing a concept of RewriteOpts that can be passed through the build.Format function which please actually calls?

@hartblanc
Copy link
Author

Okay, yep, I can give that a go 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants