vscode-bazel icon indicating copy to clipboard operation
vscode-bazel copied to clipboard

Support using @com_github_bazelbuild_buildtools//buildifier instead of download buildifier manully

Open TennyZhuang opened this issue 5 years ago • 1 comments
trafficstars

Buildifier can be run directly with bazel:

bazel run @com_github_bazelbuild_buildtools//buildifier -- -version

is it possible to use @com_github_bazelbuild_buildtools//buildifier if it was found in WORKSPACE?

TennyZhuang avatar Feb 11 '20 05:02 TennyZhuang

It looks like the command gets directly run in a shell, so you can actually set your buildifier path to something like: "bazel.buildifierExecutable": "cd /my/workspace && bazel run @com_github_bazelbuild_buildtools//buildifier --",

Unfortunately you can't use variable substitution like ${workspaceFolder} here until this lands.

Obviously this is kind of a hacky workaround but it does work!

adzenith avatar Feb 27 '20 16:02 adzenith