Open nickbreen opened 2 months ago
When formatting a BUILD file with Ctrl+Alt+L or invoking "Reformat Code" the file is formatted ignoring the .buildifier.sjon file in the project root.
Ctrl+Alt+L
.buildifier.sjon
This is inconsistent with invoking buildifier -lint fix on the command line.
buildifier -lint fix
Intellij
Craft a BUILD file with a fully qualified label:
java_library( name = "foo", deps = [ "//bar:bar", ], )
Define .buildifier.json with:
.buildifier.json
{ "buildifier_disable": ["label"] }
Execute buildifier:
buildifier -lint fix BUILD
This honours the configuration and does not shorten the //bar:bar label.
//bar:bar
Apply IntelliJ's Format Code action with Ctrl+Alt+L and notice that the label is shortened to //bar.
//bar
Build #IU-241.15989.150, built on April 29, 2024
Not relevant
2024.04.09.0.1-api-version-241
Issue https://github.com/bazelbuild/intellij/issues/6157 appears to address a similar problem but is apparently resolved.
Enabling "Automatically format BUILD/Starlark files on file save" appears to honour some of the configuration.
Format-on-save is:
-lint fix
-lint warn
Description of the bug:
When formatting a BUILD file with
Ctrl+Alt+L
or invoking "Reformat Code" the file is formatted ignoring the.buildifier.sjon
file in the project root.This is inconsistent with invoking
buildifier -lint fix
on the command line.Which category does this issue belong to?
Intellij
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Craft a BUILD file with a fully qualified label:
Define
.buildifier.json
with:Execute buildifier:
This honours the configuration and does not shorten the
//bar:bar
label.Apply IntelliJ's Format Code action with
Ctrl+Alt+L
and notice that the label is shortened to//bar
.Which Intellij IDE are you using? Please provide the specific version.
Build #IU-241.15989.150, built on April 29, 2024
What programming languages and tools are you using? Please provide specific versions.
Not relevant
What Bazel plugin version are you using?
2024.04.09.0.1-api-version-241
Have you found anything relevant by searching the web?
Issue https://github.com/bazelbuild/intellij/issues/6157 appears to address a similar problem but is apparently resolved.
Any other information, logs, or outputs that you want to share?
Enabling "Automatically format BUILD/Starlark files on file save" appears to honour some of the configuration.
Format-on-save is:
-lint fix
, but not consistently with-lint warn