Fix buildifier formatting of BUILD file #594
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When editing a file named BUILD, the command
buildifierwas executed, but the file in the editor was not reformatted properly.If I'd run
buildifier [path-to-file], the file would be reformatted as expected, so the formatter works as expected in this case.After experimenting a bit, I came up with the new command line I propose in this change. It still sends the code via stdin to
buildifier, but now is aware of the path the file has in the project. This seems to have an influence on the behavior ofbuildifier.See
buildifier --help: