lycheeverse / lychee

⚡ Fast, async, stream-based link checker written in Rust. Finds broken URLs and mail addresses inside Markdown, HTML, reStructuredText, websites and more!
https://lychee.cli.rs
Apache License 2.0
2.22k stars 134 forks source link

Add support for custom file extensions in link checking. #1559

Open mre opened 2 weeks ago

mre commented 2 weeks ago

This adds support for overwriting extensions:

lychee . --extensions md,html,txt,json,yaml

The above would only check these extensions.

This was enabled by moving to ignore (#1500 by @thomas-zahner).

I'm not 100% convinced about the design yet. Feedback welcome! Guess we should use whatever ignore::types::Types for file extension matching as it's well-maintained and more exhaustive. Switching this would remove some custom code we have in FileType.

Fixes #410

thomas-zahner commented 2 weeks ago

@mre looks good overall. Does this mean that non Markdown/HTML files are no longer checked when the new argument isn't specified?

mre commented 2 weeks ago

Yeah, good point. I think plaintext is missing to be compatible with what we had before. That's the only missing format, or? Was considering to extend it to other formats like JSON or YAML as well.