Commit graph

137 commits

Author SHA1 Message Date
Matthias
97aaadf97c
Only allow true Github links to be checked through the Github API (#201) 2021-03-31 01:38:21 +02:00
Matthias
036145eb98
Fix comments about exclusion 2021-03-30 13:58:49 +02:00
Matthias Endler
2b044a6f5b Fix exclude mail, add tests 2021-03-29 23:28:17 +02:00
Matthias Endler
5af7164409 typo 2021-03-29 00:41:34 +02:00
Matthias Endler
e28132b8a9 Add comments, reactivate integration test 2021-03-29 00:29:29 +02:00
Matthias Endler
0c0b91a727 Fix YouTube quirk, add test 2021-03-29 00:14:08 +02:00
Matthias Endler
1e49df2e03 Change Quirks::init() to Quirks::default() 2021-03-29 00:05:05 +02:00
Matthias Endler
ddac9a138e Merge branch 'master' of github.com:lycheeverse/lychee into quirks 2021-03-28 23:59:41 +02:00
Matthias
8fc7ddae11
Define set of well-known false-positives (fixes #169)
Some URIs will be excluded by default.
This can be overwritten by the user by
explicitly using `--include`.
2021-03-28 23:25:47 +02:00
Matthias
72c01df6fb
Merge "failed" status into "error" status (#191)
I think that the separation between Status::Failed and Status::Error is a
bit misleading. It was easier to implement, but from a user's perspective
they are more or less the same: something unexpected happened.
So I merged both into one: Status::Error. Still not 100% happy with the
semantics, but it's an improvement I'd say.
2021-03-28 17:20:03 +02:00
Paweł Romanowski
a45e781d47
Fix URLs with '@' parsing as emails (#177)
* Fix URLs with '@' parsing as emails

Only consider a link an email if it fails to parse as URL.

Also use a proper email validation instead of a simple '@' check.

This uses the fast_chemail crate which parses email links according
to the HTML specification (which is much more practical than checking
for RFC 5322 formatted emails).  It's also worth noting that
fast_chemail is used internally (albeit indirectly) by the
check_if_email_exists crate.  This means that email addresses
not considered valid by fast_chemail wouldn't pass link checks
anyway.

* Fix comment in test
2021-03-14 20:10:36 +01:00
Paweł Romanowski
b4de8e0983
Avoid extra newlines in output (#178)
Ensure that no extra newlines are printed in the output.
2021-03-14 19:59:52 +01:00
trevyn
1d4171328e
fix typo "continuos" -> "continuous" (#175) 2021-03-11 11:17:06 +01:00
Matthias Endler
e6032752fd Remove unnecessary clone 2021-02-28 19:24:44 +01:00
Matthias Endler
3756529e02 Cleanup 2021-02-28 19:16:24 +01:00
Matthias Endler
c496a292a6 Remove unneeded &'static 2021-02-28 19:15:59 +01:00
Matthias Endler
3a5e4ada2c formatting 2021-02-28 19:12:03 +01:00
Matthias Endler
5baaba3948 Add integration test 2021-02-28 19:09:11 +01:00
Matthias Endler
6105ef02c9 formatting 2021-02-28 16:41:14 +01:00
Matthias Endler
ba1eeed734 Directly work on requests for quirks
Add tests
2021-02-28 15:23:31 +01:00
Matthias Endler
93161a8c9a wip 2021-02-25 21:22:25 +01:00
Matthias Endler
959d2d51b3 Merge branch 'master' of github.com:lycheeverse/lychee into quirks 2021-02-25 21:00:55 +01:00
Matthias
e46710ee68
Use less-intrusive formatting inspired by eslint (#160) 2021-02-25 21:00:06 +01:00
Matthias Endler
1140809923 Clean up quirks handling 2021-02-24 00:45:36 +01:00
Matthias Endler
0f7ca7ec87 Move macro into separate file 2021-02-24 00:45:08 +01:00
Matthias Endler
749e700757 Add support for multiple matching quirks 2021-02-22 15:56:13 +01:00
Matthias Endler
1e7c1709ff working prototype 2021-02-22 14:21:04 +01:00
Joesan
cefe38ee25
Add support for reletive links in Markdown files (#150) 2021-02-22 01:11:15 +01:00
Matthias Endler
4f68f54237 Refactor check method 2021-02-21 19:59:29 +01:00
Matthias Endler
e9ed3f55b9 Rename valid_mail to check_mail to be consisten with other check fns 2021-02-21 19:54:21 +01:00
Matthias Endler
2272ad1a48 Show progress bar by default (can be disabled with --no-progress) 2021-02-21 17:19:32 +01:00
Matthias Endler
09ceda5931 Rearrange and extend tests 2021-02-21 17:00:44 +01:00
Matthias Endler
14d47d9108 Initialize exclude using Default and field overwriting 2021-02-21 16:55:26 +01:00
Matthias Endler
fa1952dd98 cleanup 2021-02-21 16:42:09 +01:00
Matthias Endler
1f6cbd1aa4 Add excludes to filter module 2021-02-21 16:35:13 +01:00
Matthias Endler
9fe1244f8c Add expect for website function in test_utils 2021-02-21 16:34:46 +01:00
Matthias Endler
ca71a5df2d Add filter module that encapsulates includes/excludes 2021-02-21 16:34:22 +01:00
Matthias Endler
e00cdbf1ae example.com -> example.org 2021-02-21 16:33:33 +01:00
Matthias Endler
8d165a3cda Add support and tests for .markdown files 2021-02-21 09:37:49 +01:00
Matthias Endler
678dc4f18e Add support for colored output 2021-02-19 00:41:49 +01:00
Matthias Endler
a4b1609424 Improve progress visualization 2021-02-19 00:23:35 +01:00
Matthias Endler
1a95aa4a44 Format 2021-02-19 00:05:14 +01:00
Matthias Endler
69e3b2cffc Formatting 2021-02-18 23:33:26 +01:00
Matthias Endler
59c6093c8a Formatting 2021-02-18 23:33:14 +01:00
Matthias Endler
5226cd10aa Change exclude behavior to make includes more intuitive
Previously an include alone would not mean that only the included
patterns were checked. Only if an exclude was given as well,
the includes would make a difference. Now, the includes on their
own will work as expected.
Moved the exlude methods into the Exclude mod.
Also changed the order of exclude tests to do the fast lookup
ones before the regex ones.
Added tests to guarantee behavior in the future.
2021-02-18 21:42:00 +01:00
Matthias Endler
fe5cea1de3 Add doc-comment tests 2021-02-18 11:14:00 +01:00
Matthias Endler
16cd67331a Add simple, standalone client
Adds a new function `lychee::check()`, which removes
a lot of boilerplate for simple cases. Adjusted the code,
tests, and documentation.
The downside is that `check` now returns a Result, so
we have to use `?` to get to the response. That's because
we have to account for the case where the given string is
not a valid URI.
2021-02-18 01:32:48 +01:00
Matthias Endler
867a9ac31a Collapse output conditions 2021-02-17 12:32:17 +01:00
Matthias Endler
8e5799a041 Always display output in the expected format
Even on stdout we print JSON now if `--format json` is set.
The reason is that not outputting any JSON when the format
is requested can be unintuitive. It is also great for debugging
purposes before sending the output to a file
with the `--output` argument.
2021-02-17 12:22:31 +01:00
Matthias Endler
0872604f18 Clean up program output
Use response.to_string instead of custom status_message function
2021-02-17 12:20:51 +01:00