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 request: Check for 404 links in README #83

Closed
pat-s opened this issue Dec 24, 2019 · 6 comments
Closed

Hook request: Check for 404 links in README #83

pat-s opened this issue Dec 24, 2019 · 6 comments

Comments

@pat-s
Copy link
Contributor

pat-s commented Dec 24, 2019

I just came across a few dead links in a README and was wondering if this could be catched via pre-commit hook :)

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented Dec 24, 2019

Great idea. What’s really awesome about pre-commit is that it supports many languages and it handles all dependencies for supported languages. So my approach would be

We can find instructions here on how to add a hook and potentially also check the existing node repo https://github.com/pre-commit/mirrors-eslint to get a feel for it. Are you interested in contributing?

Unfortunately, multiple files can't be passed to the hook at the same time, but there is an open issue for this: tcort/markdown-link-check#78

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented Dec 26, 2019

Try this adding this to your .pre-commit-config.yaml:

    -   repo: https://github.com/lorenzwalthert/precommit-markdown-link-check
        rev: v0.0.0.9002  # Use the sha / tag you want to point at
        hooks:
        -   id: markdown-link-check

See https://github.com/lorenzwalthert/precommit-markdown-link-check. Note that it can only check md or rmd READMEs as of now because of tcort/markdown-link-check#78.

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented Jan 8, 2020

Should we close this as resolved? I wonder if we should link the repo elsewhere. Or maybe wait and hope tcort/markdown-link-check#78 gets fixed soon? Because the general use case would be to apply this to all files, also .Rmd files and maybe even .R files. for link checking.

@pat-s
Copy link
Contributor Author

pat-s commented Jan 10, 2020

Sorry, forgot to reply. Didn't I do that somewhere else? Worked for me and I like it a lot!

I think you can def link it even if tcort/markdown-link-check#78 would be a nice addition.

@pat-s
Copy link
Contributor Author

pat-s commented Oct 30, 2020

@lorenzwalthert

The new r-lib/urlchecker could be a great hook :) Takes a while though - maybe in combination with caching?

@lorenzwalthert
Copy link
Owner

https://github.com/tcort/markdown-link-check works now for multiple inputs and pre-commit support was added there, hence, I suggest that. My repo https://github.com/lorenzwalthert/precommit-markdown-link-check is archived and should not be used anymore.

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

2 participants