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

Add option to remove buildifier warnings on external repository files

Open M-Kerr opened this issue 4 years ago • 3 comments

M-Kerr avatar Jan 23 '20 06:01 M-Kerr

For clarity, what do you mean by external repository files?

Do you mean things not under the folder(s) that VSCode was opened on? Do you mean things not in the bazel workspace (things pulled in via thinks like http_archive)?

thomasvl avatar Feb 05 '20 16:02 thomasvl

Yes things pulled in via rules like http_archive, where the local project is likely not the owner of the code. For example, Google's gtest currently raises a "Keyword parameter "include" for "glob" should be positional. buildifier(keyword-positional-params)" warning in its BUILD file.

It's good to be alerted to these things but it would be helpful to have an option to silence them afterwards.

M-Kerr avatar Feb 05 '20 19:02 M-Kerr

Just to understand the specific problem, is this something that only happens once you open a BUILD file from outside the workspace—the diagnostics get added to the problems view and then don't go away after you close the file?

If that's the case, I think it would make sense to either (1) not add the diagnostics to the problem view in the first place for files that aren't in the workspace (just show them in the editor) or (2) add them but remove them once the document is closed. I don't have a strong opinion about which of those is better.

allevato avatar Feb 07 '20 17:02 allevato