Excluding Paths
Sometimes it is necessary to skip paths from being checked.
For example, you might want to skip the node_modules
directory or a vendor
directory.
You might think that you can just put the path in the .lycheeignore
file, but that won’t work.
The .lycheeignore
file is only used for excluding URLs, not paths.
Instead, you can use the --exclude-path
flag to exclude paths from being checked.
Example: --exclude-path node_modules
Alternatively, you can also use the exclude_path
key in the configuration file:
exclude_path = ["node_modules"]
Here is an example config file.
Examples
Here are some more helpful use-cases for excluding paths to get you started.
Dependency Management
Exclude third-party dependencies as they’re not typically user-maintained.
lychee --exclude-path node_moduleslychee --exclude-path vendor
Build and Distribution Directories
Skip generated or compiled directories.
lychee --exclude-path distlychee --exclude-path buildlychee --exclude-path out
Temporary Files and Directories
Avoid checking transient or temporary storage.
lychee --exclude-path .tmp --exclude-path .cache
Version Control
Exclude version control directories.
lychee --exclude-path .gitlychee --exclude-path .svn
Documentation and Non-Code Assets
Skip documentation and non-code related directories.
lychee --exclude-path docs --exclude-path assets/images
Logs and Databases
Exclude directories or files storing logs or databases.
lychee --exclude-path logs