Skip to content

Generate: Use rendered provider name instead of provider name in default templates #492

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented Jun 13, 2025

Related Issue

Fixes #177

Description

The --rendered-provider-name flag is an optional flag for the generate command to provide an alternative provider name for rendering templates. Currently, this rendered provider name is not used in any of the default templates and is only used to supply a value to the .RenderedProviderName template function.

This PR replaces all uses of .ProviderName in the default templates with .RenderedProviderName. Since the rendered provider name defaults to the provider name, this change should have no regressions for existing users who are not using the --rendered-provider-name flag.

Also, the .ProviderShortName function which is used in the default provider template, will now use the rendered provider name as a basis to generate the short name instead of the provider name.

Given the following CLI input:

tfplugindocs --provider-name=terraform-provider-scaffolding --providers-schema=schema.json --rendered-provider-name=Scaffolding

.ProviderShortName should now return Scaffolding (derived from --rendered-provider-name) instead of scaffolding (derived from --provider-name).

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

@SBGoods SBGoods requested a review from a team as a code owner June 13, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command/generate enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--rendered-provider-name doesn't work
2 participants