I have a Go project that uses rules_go
(Bazel) to build the project. I'm using Gazelle to generate BUILD.bazel
files. Is it considered best-practise to commit the generated BUILD.bazel
files into version control? Or is it best-practise to always do bazel run //:gazelle
on new checkout and when new files have been added?
Yes, it's generally best practice to commit build files for several reasons.
genrule
to replace go generate
. Or you might write a test that checks the copyright headers in your source files are up to date. Or you may want to tweak the visibility rules for some of your libraries.