Skip to content
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

Cannot validate resource with no exported attributes #43

Closed
manicminer opened this issue Jan 24, 2021 · 4 comments · Fixed by #48
Closed

Cannot validate resource with no exported attributes #43

manicminer opened this issue Jan 24, 2021 · 4 comments · Fixed by #48
Assignees
Labels
bug Something isn't working
Milestone

Comments

@manicminer
Copy link

Docs for resources that don't have, or wish to, document any exported attributes, since they are identical to the arguments, cannot be validated by tfproviderdocs check.

If no ## Attributes Reference header exists, it reports:

* docs/resources/application_app_role.md: error checking file contents: missing attributes section: ## Attributes Reference

If the header is included but has alternative paragraph text:

* docs/resources/application_app_role.md: error checking file contents: attributes section byline (No additional attributes are exported.) should be: In addition to all arguments above, the following attributes are exported:

Could this check be made togglable so that the docs can still be otherwise checked?

@bflad
Copy link
Owner

bflad commented Feb 25, 2021

Just for the brief history here: this type of checking was originally created as every Terraform Plugin SDK resource implicitly had an id attribute, whether or not the schema declares it. terraform-plugin-go resources no longer have this particular behavior.

I think the preference here would be to always check for the header, since it would be good to check for accidental omissions. However, we could allow an additional byline similar to the one you mention: No additional attributes are exported.

Would this be sufficient or would you prefer the bylines be configurable?

@bflad bflad added the bug Something isn't working label Feb 25, 2021
@bflad bflad self-assigned this Feb 25, 2021
@manicminer
Copy link
Author

Hey @bflad, that makes total sense and it's logical that resources would typically set at least one attribute. I guess greater prescription makes more sense and personally I'd still want to include the heading so that it doesn't just look like it was forgotten. Allowing an alternative byline like that would be great for this sort of case 👍

@bflad
Copy link
Owner

bflad commented Feb 25, 2021

Awesome -- should be relatively straightforward to accept the alternate line by default. 😄

@bflad bflad added this to the v0.9.1 milestone Feb 25, 2021
bflad added a commit that referenced this issue Feb 25, 2021
@bflad bflad closed this as completed in #48 Feb 25, 2021
bflad added a commit that referenced this issue Feb 25, 2021
@bflad
Copy link
Owner

bflad commented Feb 25, 2021

Released in v0.9.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants