Skip to content

Enable excluding files / directories #470

@norswap

Description

@norswap

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 and node_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 README.md "./specs/**/*.md" "./meta/**/*.md" "./opnode/**/*.md"
  • this is multiple order of magnitudes faster than lychee --exclude-mail **/*.md
  • I'm just not bothering with linting my javascript packages, because it's too painful to manually list files in there to avoid the node_modules.

What I'd like to write:

lychee --exclude-mail --exclude-dir .git node_modules -- **/*.md

Ideally the "file patterns" should work just like .gitignore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions