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

Exclude specific files from link checker #39

Closed
VachaShah opened this issue Jul 22, 2021 · 1 comment
Closed

Exclude specific files from link checker #39

VachaShah opened this issue Jul 22, 2021 · 1 comment

Comments

@VachaShah
Copy link

VachaShah commented Jul 22, 2021

Hi, I have a use case where I want to exclude specific files from being checked in the link checker. Currently my args are as below:

args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json"

I want to exclude some type of text files like files with names containing a specific word example anything with word file in the name like sample-file.txt. Is there a way to achieve this?

Thank you!

@mre
Copy link
Member

mre commented Aug 23, 2021

Hey Vacha,

thanks for trying lychee! 🌟

I don't think that's easily possible at the moment. At least not within lychee itself.
You can try something like this maybe: lycheeverse/lychee#284
The idea is to use find for that or delete the unnecessary files before calling lychee.

There is also an --exclude parameter, but it only excludes URLs within the documents.
That said, it would be nice to add excludes for files or glob patterns in lychee as well.
I could think of --exclude file://path/to/sample-file.txt or even --exclude file://*file*.
But the more generic solution would probably be to fix lycheeverse/lychee#284 and add a ! option so you could write

args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" "!*file*"

I think we should move the discussion over to the main lychee repo, as this feature will need to be added to lychee itself. 😄
Will close this in favor of lycheeverse/lychee#284.

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