googleapis / googleapis/librarian
sidekick: dedup Rust templates
- Dominant language
- Go
- Stars
- 45
- Forks
- 61
- Avg merge
- 19h 11m
- Merged PRs (30d)
- 181
Description
We have a lot of duplicate templates, or at least templates that just load a partial from the right directory, e.g.:
https://github.com/googleapis/google-cloud-rust/blob/5bfc8d95e6e86df5e992546d64c0466c724ef054/generator/internal/rust/templates/crate/src/message.mustache#L16
After googleapis/google-cloud-rust#1888 we can use `{{> /templates/common/message.mustache}}` and tiny mustache files such as that one. But there are some exceptions, notably:
https://github.com/googleapis/google-cloud-rust/blob/5bfc8d95e6e86df5e992546d64c0466c724ef054/generator/internal/rust/templates/grpc-client/oneof.mustache#L16-L25
So one would need to avoid replacing `{{> oneof.mustache}}` blindly.
Contributor guide
Research direction
Inspect the Rust templates under generator/internal/rust/templates, starting with crate/src/message.mustache and grpc-client/oneof.mustache. Identify files that only load a partial through the common templates path, while preserving exceptions such as oneof.mustache. Done means duplicate wrapper templates are consolidated without replacing templates whose contents are distinct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100