-
-
Notifications
You must be signed in to change notification settings - Fork 158
Refactor input dumping and path retrieval with extension filtering #1648
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
base: master
Are you sure you want to change the base?
Conversation
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 <[email protected]>
…ved clarity and functionality
… for FileExtensions
…links Follow-up to #1559
@@ -333,40 +440,6 @@ impl Input { | |||
Ok(input_content) | |||
} | |||
|
|||
fn glob_contents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was no longer being used.
// If the path has no extension, check if we accept plaintext files | ||
// Note: We treat files without extensions as plaintext | ||
if path.extension().is_none() { | ||
return extensions.contains("txt") || extensions.contains(""); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a workaround for files without extensions. It works and probably matches the user intent, so I'd argue it's fine.
Refactor the
dump-inputs
functionality to print all files checked for links and implement file path retrieval with extension filtering in theInput
module.I added this because it was hard to troubleshoot the extension changes, but I figured it would also be helpful to people who want to see which files would be checked when they write
lychee .
.As an added benefit,
dump-inputs
now behaves more like thecheck
command and properly ignores hidden files etc.This is a follow-up to #1559.