rules_fuzzing icon indicating copy to clipboard operation
rules_fuzzing copied to clipboard

Enable automated formatting of build files through Buildifier

Open stefanbucur opened this issue 5 years ago • 4 comments

stefanbucur avatar Jun 12 '20 22:06 stefanbucur

I am not quite clear about this issue. Do you mean we need a format script like envoy_build_fixer.py, or a script downloading Buildifier and then running Buildifier FILE_PATH to fix the format problem?

tengpengli avatar Jul 02 '20 20:07 tengpengli

@stefanbucur

tengpengli avatar Jul 06 '20 17:07 tengpengli

Sorry for missing this one!

The functionality I had in mind was something that could automatically format the BUILD files once they are submitted in a PR. But I'm actually not sure how practical this is in Github. @asraa do you have a sense of the best way to do this?

At the very least, I'm thinking of having a check that fails if the BUILD files are not formatted according to the expectations of the buildifier tool.

As for the implementation itself, we should employ the simplest approach IMO - if a shell script invoking Buildifier will do the job, that's good enough.

stefanbucur avatar Jul 06 '20 17:07 stefanbucur

Github pre-submit hooks maybe? Before pushing a commit you can run a hook that runs the shell script with buildifier

Doesn't the bazel lint job currently do this?

asraa avatar Jul 07 '20 15:07 asraa