-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Glob patterns to exclude directory? #284
Comments
I thought that already works. I was wrong. |
Workaround inspired from https://stackoverflow.com/a/16595367 : |
I'm astonished by that ingenuity.😄 It does make sense, though. Thanks for mentioning that! |
thanks hehe =) |
Implementation-wise, this can be done with a use globset::{Glob, GlobSetBuilder};
let mut builder = GlobSetBuilder::new();
// A GlobBuilder can be used to configure each glob's match semantics
// independently.
builder.add(Glob::new("**/*.md")?);
builder.add(Glob::new("!./vendor/*")?);
let set = builder.build()?;
assert_eq!(set.matches("foo.md"), vec![0, 1]);
assert_eq!(set.matches("./vendor/bar.md"), vec![0]); So I think we can check if |
"It's not a bug it's a feature." 😆 |
Revisiting this, I just realized there is an easier way: lychee --exclude-path vendor --verbose --no-progress './**/*.md' Sorry for missing that. I focused too much on the glob pattern and not the original problem. In any case we should still tackle glob exclusions at some point. |
Thanks, that worked! |
I have a fairly large repository with md files spread across many directories.
So I'd like to periodically check for broken links in
*.md
files.Something like
lychee --verbose --no-progress **/*.md
works well,however I'd like to exclude
vendor/
directory to avoid unnecessary checks.Would something like
lychee --verbose --no-progress **/*.md !./vendor/*
be within scope of this project?The text was updated successfully, but these errors were encountered: