This PR exposes the top-level lint and breaking configs for buf.yaml files.
For v1buf.yaml files, there is only ever one ModuleConfig, so the
corresponding lint and breaking configs are used.
For v2buf.yaml files, if a top-level lint and/or breaking config exists, then
we return those.
Otherwise, TopLevelLintConfig()/TopLevelBreakingConfig will return nil.
We use the top-level lint/breaking configs, if possible, with image inputs, since we
cannot determine which specific v2 module config to use with images. In
the case where there is no top-level config, we fall back to defaults.
This PR exposes the top-level lint and breaking configs for
buf.yaml
files.For
v1
buf.yaml
files, there is only ever oneModuleConfig
, so the corresponding lint and breaking configs are used.For
v2
buf.yaml
files, if a top-level lint and/or breaking config exists, then we return those. Otherwise,TopLevelLintConfig()
/TopLevelBreakingConfig
will returnnil
.We use the top-level lint/breaking configs, if possible, with image inputs, since we cannot determine which specific
v2
module config to use with images. In the case where there is no top-level config, we fall back to defaults.Fixes #3080