bazel-contrib / bazel-gazelle

Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Apache License 2.0
1.21k stars 381 forks source link

override-generator: allow users to specify default values #1910

Closed tyler-french closed 1 month ago

tyler-french commented 2 months ago

If a repo specifies gazelle_default_attributes to be something different than the gazelle_override tag defaults, the user should be able to pass this to the override generator so that the output takes this into consideration, and skips outputing redundant information.

This PR allows the user to specify a default build_file_generation and build_file_proto_mode that is used in their repo, and generate appropriate overrides.

These two tags need to be handled manually after the other tags because of the non-trivial logic in them.