-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Enable excluding files / directories #470
Comments
We also touch on that in #418.
(Not exactly, because it would check html files as well, but that could be configurable as well.)
|
@mre It may even by default ignore anything in ".gitignore". |
I fall into the same situation, where I wanted to ignore (at least) node_modules. Ignoring the gitignore list would make sense to me. |
This feature would be really helpful, right now I do something like
but I'd prefer some kind of way to ignore whole directories |
Update
Usage example based on the original request above:
Regex patterns are supported. @norswap, as a side note, did you know that there's a windows executable build, which could help you with any performance issues because you could avoid the WSL virtualization layer? TODO
|
Great to hear! I was weak and purchased a mac :D |
I may have to file a potential bug but we are big fans of lychee, I spent the last two days in between other tasks unable to get regex working at all with |
Sweet. I've added some more examples to the docs to help you get started. Feel free to add a comment here if you run into an issue. |
OK, I will not finish the draft of the separate bug report I was writing, I will move and edit it to here. We want to dynamically add or remove a collection of web pages per directory, and the directory name is based upon https://github.com/usnistgov/OSCAL-Reference/tree/fb13809fea9baf44b9d0f341f694ee1dae66e864/site Inside of When cloning our code, I attempted to configure different variations of lychee --exclude-file ./support/lychee_ignore.txt \
--config ./support/lychee.toml \
--output lychee_report.md \
--verbose --format markdown \
--exclude-path="site/public/models*" \
site/public/**/*.html lychee --exclude-file ./support/lychee_ignore.txt \
--config ./support/lychee.toml \
--output lychee_report.md \
--verbose --format markdown \
--exclude-path="*site/public/models*" \
site/public/**/*.html lychee --exclude-file ./support/lychee_ignore.txt \
--config ./support/lychee.toml \
--output lychee_report.md \
--verbose --format markdown \
--exclude-path="*/models*" \
site/public/**/*.html I still see lychee linkcheck failures that are under lychee --exclude-file ./support/lychee_ignore.txt \
--config ./support/lychee.toml \
--output lychee_report.md \
--verbose --format markdown \
--exclude-path="site/public/models/develop" \
site/public/**/*.html I am using lychee |
Are you mixing up regex with glob, maybe? |
I see what I did there, apologies. Ah, well in that case, I go back to test and come back later. 😬 |
Hi folks,
I am able to exclude path using
Same for 0.13.0 and for the nightly 11d8d44 |
Try
|
Yes this works. But the online documentation states I can do thinks like
|
Well, the documentation mentions |
Replaced the pattern with I haven't looked into why your original regex didn't work. I think it should (?). If someone finds the time, I'd appreciate a pull request for adding more cases. Maybe there is a bug in the path exclusion handling (or we need to document it better). |
FYI: the suggested
|
Looks like it doesn't match the full path, but just the last part? Can you play around with various regexes that match the filename and extension? Like |
Exclusion seems inconsistent. Here's a small section of output from
|
Looks like |
With release 0.16.0 we have released #1500. With this change, lychee ignores files that are ignored by git by default. This seemed like the most sensible default to us and aligns with ripgrep. The behaviour can be disabled with the Thanks to ignore you can now also ignore files from scanning with For full documentation of what files are ignored see: standard_filters. All standard filters - with the exception of hidden files ( |
This might be a case of me being particularly dense, but there doesn't seem to be a way to exclude directories and files from being parsed by lychee (other than by not including them in the inputs). The existing
exclude
flags are all about patterns of links not to consider.Why this matters: on my machine, lychee is quite slow at trudging through e.g.
.git
andnode_modules
to look for files that either aren't there or I don't want checked. (There are external reasons why it's slow, not least of which is using WSL.)Still, as is, I'm forced to write:
lychee --exclude-mail **/*.md
node_modules
.What I'd like to write:
Ideally the "file patterns" should work just like
.gitignore
.The text was updated successfully, but these errors were encountered: