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

hook fails if comment tags not found #17

Closed
brandonjbjelland opened this issue May 20, 2018 · 3 comments
Closed

hook fails if comment tags not found #17

brandonjbjelland opened this issue May 20, 2018 · 3 comments

Comments

@brandonjbjelland
Copy link

I would expect a tool like this to operate in a very standard mode, not trying to do anything like inserting between comments. This is your design decision to make but I'd much prefer a more standard execution of the tool like:

terraform-docs md ./ | cat -s | ghead -n -1 > README.md

This approach is markdown linter compliant and supports the standard of putting your documentation in the main.tf

screen shot 2018-05-17 at 12 48 57 am

@antonbabenko
Copy link
Owner

My reasoning for making it using comments was that not everybody wants to overwrite the whole README.md but rather put it into specified section of that file.

Later we may have a possibility to specify which file to update instead of README.md as now.

Regarding the issue with sed... unexpected EOF. It is happening not because a comment tag was not found, but because sed command does not work on all platforms equally well (I tested it with brew'ed sed on Mac). The most platform agnostic way seems to be using Perl (#15).

I will keep this issue posted when a new pre-commit hook is released (during today or tomorrow).

@antonbabenko
Copy link
Owner

v1.7.2 is using Perl and keeps a temporary file in a temporary directory.

Please give it a try and let us know how it goes.

@BennyHarv3
Copy link

BennyHarv3 commented Aug 22, 2018

v1.7.3 at least got me past this error. I wanted all of the documentation in main.tf to overwrite the README.md. The hook doesn't actually write the README contents like #7 asks for still, but this could probably be closed.

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

No branches or pull requests

3 participants