-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add clean
to buf.gen.yaml
#3130
Conversation
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
I'm not sure why I'd want this - why would I want per-plugin config of cleanup? |
This is based on @timostamm's comment, which I agree with
It's convenient not having to specify the flag all the time/have it explicitly set in configurations so users can easily reference it. And it does make the association with |
Why would I want to set it on a per-plugin basis? What's an example of where I'd want to clean for one plugin, but not for another? Perhaps I could want to do this globally, would be interested what that'd look like from a config perspective. |
This PR targets branch `add-buf-gen-yaml-clean` and moves `clean` to `buf.gen.yaml`'s top level, from the plugin level. --------- Co-authored-by: Doria Keung <doriable@users.noreply.github.com>
clean
to plugin configs in buf.gen.yaml
clean_plugin_outs
to buf.gen.yaml
clean_plugin_outs
to buf.gen.yaml
clean
to buf.gen.yaml
Updated to |
buf.build/docs needs to be updated |
As a quick follow-up to #3124 and in response to #3124 (comment), this adds a `clean` config key to `v2` `buf.gen.yaml`, for example: ```yaml version: v2 clean: true plugins: - local: custom-gen-go out: gen/go opt: paths=source_relative strategy: directory - protoc_builtin: java out: gen/java ``` When running `buf generate` with the above configs, the outs set to each plugin (e.g. `gen/go` and `gen/java`) will be removed before code generation is run. If `buf generate --clean` flag is set, then that will always take precedence, even if `clean: false` in the configuration. And likewise, if `buf generate --clean=false`, and `clean: true` in the configuration, then we would not delete the out directories. --------- Co-authored-by: Oliver Sun <73540835+oliversun9@users.noreply.github.com> Co-authored-by: Oliver Sun <osun@buf.build> Co-authored-by: bufdev <4228796+bufdev@users.noreply.github.com> Co-authored-by: bufdev <bufdev-github@buf.build>
As a quick follow-up to #3124 and in response to #3124 (comment),
this adds a
clean
config key tov2
buf.gen.yaml
, for example:When running
buf generate
with the above configs, the outs set to each plugin(e.g.
gen/go
andgen/java
) will be removed before code generation is run.If
buf generate --clean
flag is set, then that will always take precedence, even ifclean: false
in the configuration. And likewise, ifbuf generate --clean=false
,and
clean: true
in the configuration, then we would not delete the out directories.