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

Add hook to create readme #12

Closed

Conversation

GabeL7r
Copy link

@GabeL7r GabeL7r commented Apr 23, 2018

No description provided.

@GabeL7r GabeL7r closed this Apr 23, 2018
@GabeL7r GabeL7r reopened this Apr 23, 2018
Copy link
Owner

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the code. I wonder how we can make it work nice and flexible.

path_uniq="${path_uniq//__REPLACED__SPACE__/ }"

pushd "$path_uniq" > /dev/null
terraform-docs md ./ > README.md
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will overwrite the whole README.md which is not what everyone wants.

I think we should make some things configurable via pre-commit arguments:

  1. Filename to create (by default, README.md)
  2. Beginning and end markers where terraform-docs content should be placed between (by default, invisible blocks like <!-- BEGINNING OF TERRAFORM-DOCS HOOK --> and <!-- END OF TERRAFORM-DOCS HOOK -->). If markers were not found - replace the whole file.

What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! I'll update the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants