* windows
* Introduce --root-path
* lint
* lint
* Simplification
* Add unit tests
* Add integration test
* Sync docs
* Add missing comment to make CI happy
* Revert one of the Windows-specific changes because causing a test failure
* Support both options at the same time
* Revert a comment change that is no longer applicable
* Remove unused code
* Fix and simplification
* Integration test both at the same time
* Unit tests both at the same time
* Remove now redundant comment
* Revert windows-specific change, seems not needed after recent changes
* Use Collector::default()
* extract method and unit tests
* clippy
* clippy: &Option<A> -> Option<&A>
* Remove outdated comment
* Rename --root-path to --root-dir
* Restrict --root-dir to absolute paths for now
* Move root dir check
This introduces an option `--cache-exclude-status`, which allows specifying a range of HTTP status codes which will be ignored from the cache.
Closes#1400.
As of almost two weeks ago, Git's home page at https://git-scm.com/ was
switched to a static website that uses lychee to verify links (already
catching a broken one: https://github.com/gitgitgadget/git/pull/1812).
For substantially longer, the Git Credential Manager uses lychee to
validate the links in its documentation.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This adds support for formatting responses in different ways.
For now, the options are:
* `plain`: No color, basic formatting
* `color`: Color, indented formatting (default)
* `emoji`: Fancy mode with emoji icons
Fixes#546
Related to #271
In many circumstances (GitHub Pages, Apache configured with MultiViews,
etc), web servers process URIs by appending the `.html` file extension
when no file is found at the path specified by the URI but a `.html`
file corresponding to that path _is_ found.
To allow Lychee to use the fast, offline method of checking such files
locally via the `file://` scheme, let's handle this scenario gracefully
by adding the `--fallback-extensions=html` option.
Note: This new option can take a list of file extensions to use; The
first one for which a corresponding file is found is then used.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* Enclose Markdown links in brackets
The current clippy version (v0.1.78) says "you should put bare URLs
between `<`/`>` or make a proper Markdown link" and refers to
https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* Enclose documentation item in backticks
Clippy v0.1.78 complains about the IPv6 network mask, insisting that it
is missing backticks. So backticks it gets.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* Avoid error claiming `Add(usize)` is dead code
Clippy v0.1.78 identifies this as dead code. However, further down in
the same file, there is clearly a user:
impl Handler<Result, Result> for Add {
This might be yet another incarnation of
https://github.com/rust-lang/rust/issues/56750
Let's just mark it as intentionally dead-code, even if this is untrue,
to make clippy happy again.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---------
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Adds support for accept ranges discussed in #1157. This allows the user to specify custom HTTP status codes accepted during checking and thus will report as valid (not broken). The accept option only supports specifying status codes as a comma-separated list. With this PR, the option will accept a list of status code ranges formatted like this:
```toml
accept = ["100..=103", "200..=299", "403"]
```
These combinations will be supported: `..<end>`, ` ..=<end>`, `<start>..<end>` and `<start>..=<end>`.
The behavior is copied from the Rust Range like concepts:
```
..<end>, includes 0 to <end> (exclusive)
..=<end>, includes 0 to <end> (inclusive)
<start>..<end>, includes <start> to <end> (exclusive)
<start>..=<end>, includes <start> to <end> (inclusive)
```
- Foundation and enhancements for accept ranges, including support for comma-separated strings and integration into the CLI.
- Implementations and updates for AcceptSelector, including Default, Display, and serde defaults.
- Address and fix various errors: clippy, cargo fmt, and tests.
- Add more tests, address edge cases, and enhance error messaging, especially for TOML config parsing.
- Update dependencies.
- Implemented enhancements to include fragments in file links
- Checked links to markdown files with fragments, generating unique kebab case and heading attributes.
- Made code more idiomatic and added an integration test.
- Updated documentation.
- Fixed issues with heading attributes fragments and ensured proper handling of file errors.
E-Mail checks cause too many false-postives,
so we put them behind a flag.
* `--exclude-mail` is deprecated (to be removed in 1.0)
* `--include-mail` is the new flag
This PR also removes the obsolete tests for `--exclude-file`, which was superseded by `.lycheeignore`.
Fixes#1089