gruntwork-io / pre-commit

A collection of pre-commit hooks used by Gruntwork tools
https://gruntwork.io/
Apache License 2.0
484 stars 155 forks source link

Markdown link check pre-commit hook doesn't allow user-defined configuration #78

Open tspearconquest opened 2 years ago

tspearconquest commented 2 years ago

Describe the bug Unable to provide my own configuration to markdown-link-check via pre-commit

To Reproduce

Expected behavior I added the markdown-link-check hook to my .pre-commit-config.yaml, and ran pre-commit run -a but found that private links I'm trying to check give a 503. For my case, I am trying to check markdown in a private Gitlab repo. I found I can add a cookie header to the config in order to grant the tool access to check these links if I run markdown-link-check -c config.json README.md but if try to do it by adding -c config.json to the args as below in .pre-commit-config.yaml, then markdown-link-check fails to run properly and throws an error about the configuration:

  - id: markdown-link-check
    args:
    - -c config.json

So I did some checking and I found the script creates its own temp config and provides the -c flag itself to markdown-link-check, which seems to conflict with my -c flag in the args.

Nice to have

Additional context Add any other context about the problem here.

havimaki-agilebits commented 1 year ago

I have also run into this issue where I need to pass in a configuration file in order to set Authorization headers. Would love to have this updated to reflect markdown-link-check's inherent functionality!