princjef / gomarkdoc

Generate markdown documentation for Go (golang) code
MIT License
380 stars 60 forks source link

Pre-commit support #104

Open desebjohnston opened 1 year ago

desebjohnston commented 1 year ago

Hello! Very nice tool. I just wanted to request official support for pre-commit if at all possible as this would be a very nice integration if working appropriately.

This team from turo has attempted it: https://github.com/turo/pre-commit-hooks

The problem is the re-embedding seems to always cause a pre-commit failure and re-indexing of the main README.md, so there's an infinite recursion of failure.

princjef commented 1 year ago

Hi @desebjohnston, pre-commit is definitely a good use case for this tool. I'm not familiar with the project you mentioned, but I would expect the command to run the same way within a pre-commit hook as it runs under normal execution. If you could provide some details of how gomarkdoc is being invoked or possibly an example where the problematic behavior you're seeing occurs, that will help identify any issues so they can be fixed.