Skip to content

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

Merged
mre merged 12 commits into
masterfrom
extensions
Mar 2, 2025
Merged

Add support for custom file extensions in link checking.#1559
mre merged 12 commits into
masterfrom
extensions

Conversation

@mre

@mre mre commented Nov 7, 2024

Copy link
Copy Markdown
Member

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

Comment thread lychee-bin/src/main.rs Outdated
Comment thread lychee-bin/src/options.rs Outdated
Comment thread lychee-lib/src/collector.rs Outdated
@thomas-zahner

Copy link
Copy Markdown
Member

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

@mre

mre commented Nov 8, 2024

Copy link
Copy Markdown
Member Author

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.

mre and others added 2 commits February 24, 2025 22:36
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).

Fixes #410
Co-authored-by: Thomas Zahner <thomas.zahner@protonmail.ch>
@mre mre requested a review from thomas-zahner February 26, 2025 00:23
@mre

mre commented Feb 26, 2025

Copy link
Copy Markdown
Member Author

@thomas-zahner, I made all changes. Can you check again?

@thomas-zahner thomas-zahner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it yet but it looks good, I like the new type 👍

Comment thread lychee-lib/src/types/file.rs
Comment thread lychee-lib/src/types/file.rs Outdated
Comment thread lychee-lib/src/types/file.rs
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

Successfully merging this pull request may close these issues.

Don't require <input>; Find all supported files in cwd automatically

2 participants