Commit f6706de
authored
feat: improve configuration of the plugin (#1649)
* feat: improve configuration of the plugin
This PR is the first of a series that is meant to improve the structure
of the gapic generator. This PR improves how the plugin configuration
flow works, and provides a centralized place for new plugin args to be
mapped to specific configuration options. It also makes it easier to do
validation by moving them into the specific options, rather than having
this all in one big parse function.
There's a couple things called out as TODOs for renaming. The point
here is to keep this PR minimally invasive, as it avoids having to visit
the callsites for all the places which rely on the current names. We
can do the renames individually through a series of small followups.
The main oddity here is the error feedback in the option pattern.
Rather than iterating through the args and collecting opts to apply, we
apply them when encountered which lets us fail immediately. We could
collect errors at apply, but I favored a "fail as early as possible"
approach to avoid risks of silently missing validation opportunities.1 parent d506312 commit f6706de
3 files changed
+386
-125
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments