Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildifier is still printing errors to stderr even when -format json is used #1179

Open
aignas opened this issue Jul 30, 2023 · 0 comments
Open

Comments

@aignas
Copy link

aignas commented Jul 30, 2023

Given an invalid BUILD.bazel file:

Bad syntax

When running `buildifier as follows I get:

$ buildifier -lint=warn -mode check -warnings=all -format json BUILD.bazel
BUILD.bazel:1:11: syntax error near syntax
{"success":false,"files":[{"filename":"BUILD.bazel","formatted":false,"valid":false,"warnings":[]}]}

Right now the users attempting to write a parser for buildifier output have to write two parsers:

  • One for stdout that would be in JSON.
  • One for stderr that would be plain text.

This does not make it easy for users to write one. I would assume that most of the syntax error information could be surfaced to the user to provide easier to parse diagnostic messages.

For what people have to do currently, see mfussenegger/nvim-lint#335

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

No branches or pull requests

2 participants
@aignas and others